get your cocoa on integrating objective-c into unity iphone apps brian robbins president/founder –...
DESCRIPTION
Why? Use the best technology for what you need Feel like an iPhone app Access to any iPhone featureTRANSCRIPT
Get Your Cocoa OnIntegrating Objective-C into Unity iPhone
Apps
Brian RobbinsPresident/Founder – Riptide Games
[email protected]: @dubane
Slides & Source Code: www.dubane.com/cons/
Unity Unite – October 30, 2009
Overview• Background• Creating views• Messaging• Pros & Cons• Q&A
Why?• Use the best technology for what you
need• Feel like an iPhone app• Access to any iPhone feature
Creating Views• Demo
Creating Views• Key code• In ApplicationDidFinishLaunching//Get the application windowUIWindow *topWindow = [[[UIApplication sharedApplication] windows]
objectAtIndex: [[[UIApplication sharedApplication] windows] count]-1];myParentView.center = topWindow.center;[topWindow addSubview:myParentView];
//Next create the MenuViewControllermenuVC = [[MenuViewController alloc] initWithNibName:@"MenuViewController"
bundle:nil];
//Add it to the window so it can be active//Now we can add our Menu to the landscape View and it will appear
[myParentView addSubview:menuVC.view];
Messaging• Demo
Messaging Overview
• Poll NSUserDefaults for message from Unity
• Poll PlayerPrefs.GetString for message from Cocoa
Limitations• Speed?• One message per Unity update• Text only, no binary
Pros• Do anything you want on iPhone• Feel like a native iPhone app• Faster menu design & iteration• Separate workload
Cons• Extra work to test in Unity• Limitations of message system• Fragile vs future Unity updates
What is enabled• Cocoa menus• In App Purchase• Video playback• Different sound control• OpenFeint, Plus+, etc. integration• AdMob, etc.• PinchMedia, Localytics, etc.• Anything else you want!
Final Thoughts• Pretty straightforward and
lightweight• Make menus & UI native iPhone• Use Enhancement Pack• http://technology.blurst.com/a-cocoa-
based-frontend-for-unity-iphone-applications/
Q & ABrian Robbins
President/Founder – Riptide [email protected]
Twitter: @dubane
Slides & Source Code: www.dubane.com/cons/