Unity and iOS are easier to interact with. Direct export Xcodeproject, this everyone knows how to operate, if it takes two times to develop iOS code into unity, in fact, the integration is very easy to find the exit Xcodeproject within the IPHONE_VIEW.MM Intermediate Onunityready () method. Unityios in a view,[getappcontroller()showgameui:_maindisplay - window ]; Load the game view, this method in Unityappcontroller,-(void) Showgameui: (uiwindow*) window, show view as _rootview, If you want to integrate your own view, Addsub will be able to. The details will be clear to iOS people at a glance. It's not the first to know about iOS. Interaction is very easy, after you merge project, and then change the unity exported xcodeproject, directly replace the merge project data and libraries directory can be, do not have to merge each time. Change iOS code directly in the merge project changes can be
The code for unity and iOS interaction must be written in the class under the exported Projectclass file, written elsewhere in the call unresponsive, unity calls iOS
[DllImport ("__internal")]private static extern void _hideview (); [ DllImport ("__internal")]private static extern void _displayingview (); [ DllImport ("__internal")]private static extern void _sendjsondata (string stringvalue); [ DllImport ("__internal")]private static extern void _rotatetrigger (int index);
Unity calls the iOS declaration interface, which is the number of references. You can call the corresponding method when you use it. _rotatetrigger(-1); Suggest that you infer the device to call,
iOS side
+ (void) Rotatefurnitureto3d: (const char *) strangle{ unitysendmessage ("Target", "rotatefurniture", strangle);}
This is an iOS call to unity using code that is written in the corresponding class, and unity has provided the corresponding method.
But Unity calls iOS, because Unity is C # calling code OBJECT-C does not support
extern "C" { void _sendjsondata (const char* stringvalue) { [Ardbmanager Storeprogramjson: StringValue];} }
You can interact. Details can also be a test that I do not understand, in exchange at any time. Make a little progress every day
Unity and iOS Alternate