Search Unity

Fast Question! :) Is it possible to integrate Unity inside an standard app?

Discussion in 'iOS and tvOS' started by Juan, May 30, 2011.

  1. Juan

    Juan

    Joined:
    May 21, 2009
    Posts:
    142
    I mean, i have a client with an standard app developed (simple app with some documents and some photos) and they want to integrate a 3d interactive inside the app, is that possible? (even if it's necessary to rewrite the entire app in the xcode project from unity).

    Cheers!!!
     
  2. Juan

    Juan

    Joined:
    May 21, 2009
    Posts:
    142
    No ideas about that?

    Is not possible to do that?

    Cheers.
     
  3. friendlydev

    friendlydev

    Joined:
    Dec 21, 2008
    Posts:
    153
    Hi Juan,

    not 100% sure, but I guess you might want to check out the "NativeToolkit Plugin" by Prime31. Look it up on the Unity Asset Store.

    Cheers
     
  4. gamesbyamy

    gamesbyamy

    Joined:
    Aug 14, 2010
    Posts:
    1
    I've managed to sneak in a RootViewController to my unity3d app by modifying the code in the AppController's OpenEAGL_UnityCallback function. I'm only overlaying simple views, temporarily and with unity paused. I'm not sure what performance would be like shoehorning a complex app in via that method but it should be possible at least.

    No idea if my approach is the most elegant.
     
  5. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,624
    Well we made AppController available to you to do exactly that ;-)
    For 3.4 we fiddled a little with it so it should be far easier to integrate native things (will come out soon, but no ETA)
     
  6. redd

    redd

    Joined:
    Jul 23, 2009
    Posts:
    122
    Ya, you can definitely do it, although maybe not in the way you're thinking. For instance, if you're thinking that you would have a Obj-c app that would call Unity as-needed and on-demand, then maybe not. But, you can have Unity running and still have the full functionality of Obj-c-based dev available to you, too.

    My experience is that Unity needs to run and do it's own thing on startup, but you can definitely override once it's up. For instance with Gears, Unity starts up first, but the first Unity loaded scene initiates a obj-c class which then gets me fully back into Obj-c world. I don't let Unity take control again until the user actually loads in a gameplay level. Almost all UI and other non-game functionality is Obj-c, and Unity just handles the game elements itself with the Obj-c stuff determining what works when. Although I limited myself mostly to just UI stuff, there's no reason you couldn't do anything you normally would do on the Obj-c side, including 2D animations, etc. You will have a performance hit on your Obj-c stuff if you don't pause the Unity system in the background though (and even then, there will still be a small performance hit.)

    There's probably a way to make Unity load "on-demand" and perhaps even unload, but I don't know how, nor may it be worth it (unless you're really memory constrained in what you're doing on the Obj-c side or wishing to do some very fancy animations or other transforms.)