Unity iPhone scene and Xcode-GUI possible?

Hi, ive just created an unity-test-project and build it to my ipad. Now i want to know, if its possible to create the GUI completely with xcode using UIButtons or something like that. My unity-scene would be run not in fullscreen-mode but in an extra view. So half unity, half xcode-view. Does anybody know if thats possible?

Thanks, yosh

I've managed to embed UIViews with controllers built in Interface Builder into Unity's rendering window, however it is simply overlaid as a subview of the Unity view. Actually controlling the rendering window I haven't messed with, however you could just restrict your rendering window size in Unity by using the Camera Normalized Viewport Rect and only making it fill the section of the screen you wish. Then any further UIViews you wish to embed should be able to cover them up quite easily.

Getting Unity and your Objective C code to talk is another matter. You should check the plugins section of the Unity iPhone manual for methods of talking to and from managed to native code, and also check the Blurst website for their Cocoa Frontend to Unity.

Note that Blurst's method pauses Unity and gives control back once their Frontend is complete. If you find the Unity UIView using their method, you MUST do it inside the "applicationDidBecomeActive" delegate in order to be able to embed your own views. Doing it before that will result in no custom UIViews becoming embedded (this had me stumped for a few days). Also I believe that since the Blurst post, Unity's appController class has changed slightly, so to get the window, the easiest way I found was as follows:

UIApplication *app = [UIApplication sharedApplication];
window = [app keyWindow];

once again, making sure you call that inside the "applicationDidBecomeActive" delegate.

One other quick note, I couldn't get any of my embedded UIViews to respond to rotation delegates, so I setup a manual callback from Unity when it detected it, and performed a manual rotation using CGAffineTransformRotate on the currently embedded UIView. A bit of a work around but worked properly in the end.

Murcho, how did you get Blursts tutorial to do what it should?

I tried to create their setting but i am stuck with the content of FBscene Manager which they did not describe.

This should have two methods like these, but what do they do exactly?

  • (void) startScene : (NSString *) scene;
  • (void) clearScenes;

Hi guis, im going mad trying to add 2 buttons on the top of the unity3d window...nothing works...

my project needs a UIWebView with a local navigation system (done and working) and a back button on the top of the unity3d window...but i can't find any valid solution/tutorial to add overlay buttons on top of the unity main window...any help would be really appreciated.

Jennifer.

I’m working on the same thing. I’m calling the Unity game a web view and making a popup window from a bar button. Then I’m making the popup window with the GUI controls permanently “popped up” and the bar button invisible and nonreactive. Finally, I’m programming the popup buttons to send commands to the webview server, so that I can essentially make GUI commands in XCode. I haven’t done any of that yet, but that’s the idea. What do you guys think? (Sorry, not an answer at all, just a comment)

I tried the Blurst tutorial and had the same stymie. Also, if I remember correctly, the blurst tutorial does not use ARC. I wonder if ARC should be turned off since it does not exist on Unity? Or would it not matter since you would just say something like "when you click this send command@“unity command code here” to unity (place that receives commands) in webview? I assume one would have to write essentially a translation for any command made in xcode to control unity. Like an unity-xcode dictionary. BTW For some reason “@#34;” keeps being inserted. I can’t seem to get rid of it. Sorry.