简体   繁体   English

ios Unity 3d集成到本机ios代码中

[英]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. 我有一个在Xcode 5.1中创建的原生iOS代码,我还有一个示例统一3d ios项目代码。 I want to merge or integrate unity 3d ios code into my native ios code. 我想将Unity 3d ios代码合并或集成到我的本机ios代码中。 How can I do that the same Thanks In Advance 我怎么能这样做同样的感谢提前

Check this out: 看一下这个:

http://docs.unity3d.com/Manual/PluginsForIOS.html 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: 简单地说:首先从一个类开始,让我们说Unity3D的FooPlugin.cs执行以下操作:

[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: 然后构建XCode项目并添加一些实现此方法的FooPlugin.m:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM