- Home /
Adding a Unity 3D view on top of UIKit again
I know that this could've been asked many times before. But, I would still like to explore the possibility of loading a Unity 3D view to a running app that was built without using Unity.
In this case I would be displaying 3D objects on top of a camera view, and I'm using Unity for this. The camera part is already handled by another 3rd party library.
There's a callback in every generated Unity Xcode project:
int OpenEAGL_UnityCallback(UIWindow** window, int* screenWidth, int* screenHeight, int* openglesVersion)
I would like to use this window and assign my own view on it.
What I don't understand is how to start unity "on-demand"? Such as when we're loading a view of a UIViewController, not when the application is launched.
Could I just use the "StartUnity()" setup that was usually being called on application:didFinishLaunchingWithOptions: ?
Then, I could read this callback, and add the view controler's view into this window. This window would be the app delegate's window.
Has anyone done this before?