Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a typical UIKit application with three buttons - one opens an RSS feed in a UITableView, the second opens some kind of gallery view, and the third opens a Unity 3D game.

Is it possible and how easy it is to support both in one application?

share|improve this question
up vote 4 down vote accepted

This will be improbably difficult. Unity is not a standalone view wholly contained within a UIView subclass instance; if it were, this would be easy enough, you'd just add the view as a subview when you wanted to activate the Unity game and remove it when you were done (or use any number of similar UIView manipulation techniques).

Unity, however, expects to be the authoritative source of the application's behavior, so trying to host a Unity game within a "regular" iOS application is going to result in you fighting that behavior and spending a lot of effort for minimal gain.

You should consider implementing the behavior the other way around: have a Unity game which occasionally defers to some Objective-C based UIKit code via native plugins, which basically involves:

  • creating an Xcode project or target that contains the Objective-C code for manipulating the desired UIView objects.
  • conforming to the Unity plugin API so you have an entry point into your plugin from the rest of your Unity project.
  • invoking that entry point as-needed.

If you are not keen on building all that yourself, something like the iOS bridge, or just resign yourself to building your GUI with Unity's built-in primitives.

share|improve this answer
Took more than a year to finally get an answer. Thanks a lot for the useful info :) – Guntis Treulands May 14 '14 at 19:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.