-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTNAppController.mm
More file actions
36 lines (27 loc) · 902 Bytes
/
Copy pathTNAppController.mm
File metadata and controls
36 lines (27 loc) · 902 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// TNAppController.m
// Unity-iPhone
//
// Created by ManuQiao on 16/7/7.
//
//
#import <UIKit/UIKit.h>
#import "UnityAppController.h"
#import "UI/UnityView.h"
#import "UI/UnityViewControllerBase.h"
#import "ViewController.h"
@interface TNAppController : UnityAppController
@end
@implementation TNAppController
- (void)willStartWithViewController:(UIViewController*)controller {
// 新建自定义视图控制器。
ViewController *viewController = [[ViewController alloc] init];
// 把Unity的内容视图作为子视图放到我们自定义的视图里面。
[viewController.view addSubview:_unityView];
[_unityView setFrame:CGRectMake(100, 100, 100, 100)];
// 把根视图和控制器全部换成我们自定义的内容。
_rootController = viewController;
_rootView = _rootController.view;
}
@end
IMPL_APP_CONTROLLER_SUBCLASS(TNAppController)