Unity and iOS Alternate

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.