Sagar Jadhav
Sagar Jadhav

Reputation: 249

ios Unity 3d integration into native ios code

I have a native iOS code which is created in Xcode 5.1, Also I have one sample unity 3d ios project code. I want to merge or integrate unity 3d ios code into my native ios code. How can I do that the same Thanks In Advance

Upvotes: 3

Views: 468

Answers (1)

Injectios
Injectios

Reputation: 2797

Check this out:

http://docs.unity3d.com/Manual/PluginsForIOS.html

Briefly: Start first from simply one class let's say FooPlugin.cs in Unity3D which do the following:

[DllImport ("__Internal")]
private static extern float _FooPluginFunction();

which has public method:

public static void FooPluginFunction()
{
    _FooPluginFunction(); // call the native extension
}

Then build XCode project and add some FooPlugin.m which implements this method:

void FooPluginFunction() {
   // this is where native world is met
}

Upvotes: 1

Related Questions