I would like to know whether my approach to integrate unity game in native iOS application is good enough and will not face issues going further with the same.
- Built the UnityFramework target in the iOS application exported from the Unity game.
- Added the framework in the existing native iOS application
- Added the required User-defined settings in the existing native iOS application’s build settings
- In the existing application viewController’s button action method, called the below method to launch the unity window.
[[UnityFramework getInstance] runEmbeddedWithArgc:args.count argv:cargs appLaunchOpts:rage:{}];
- Added a subclass for UnityAppController and in the preStartUnity method resized the window.
Eg.
-(void) preStartUnity {
[self.window setFrame:CGRectMake(0, 0, 150, 150)];
}
Any suggestions on dismissing the view. For now, I did
[[UnityFramework getInstance] unloadApplicaion:YES]; + UnityAppController.window hidden and then called showUnityWindow to display the game again.
Also, incase if I need to access any app delegate functionalities I can call them from my existing AppDelegate to the UnityAppController subclass
Please let me know, if there are any simple and better approaches for integration