Dynamic Unity Integration

Hi,

have had a deeper look into the Xcode projects created by Unity. Those projects do typically switch into Unity mode right after the App has initialized.

What I want to do is integrate Unity views dynamically into arbitrary view hierarchies, maybe even more than one Unity view on a page.

I already did re-factorize the code created by Unity into a clean framework with re-usable components and also had some luck with creating the Unity view on demand…

Anyway, is that what I want to achieve possible at all? Is there some existing activity maybe on github or anywhere, that I may join?

Thx ia for any support,

Ekki

I don’t think you could create more than one Unity view… Although maybe, I haven’t tried it myself. You could potentially instantiate the AppController.mm twice. It seems like it could get quite tricky.

I was thinking ideally it’d be better to place multiple cameras in Unity and then overlay one transparent EAGLView over whatever. Although I don’t know if that will work either.

I’ve been working pretty in depth with intermixing Unity and Cocoatouch myself for the past few months. I’m curious to know what you’ve discovered about it. You say you want to integrate Unity views? Are you referring specifically to the ‘UnityViewController’ variable in the AppController.mm? Or something else? Because in my explorations of this I found I had to treat Unity as an entire window, and I just switch the entire window Unity generates with another window that contains cocoatouch elements. Grabbing just the UnityViewController or the sGLViewController or the eaglview view was not sufficient. I had to grab the whole window unity added those elements to in order to keep touch input and screen autorotation working correctly. Did you find another way to do it?

Also, I don’t believe there is any other github or project concerning this. I’ve researched this very heavily and couldn’t find anything but a few limited posts here and there.

you can’t create applications like this.

Unity is an own singleton object basically. You can fire it up once and you can shut it down again, but you can neither load a second one nor start it up again if you shut it down.

Unity is an engine that creates fully selfcontained applications, is no framework to use nor intend as such nor is there any support present to use it as such - independent of the platform - the XCode export for iOS is simply there cause its required to go to iOS as per the iOS dev contract you signed (which is blatantly ignored by all devs using flash or udk tools) and cause its the best and only way to allow extendability to make use of native iOS features (something never possible on udk or flash due to exactly this reason)