统一集成与Eclipse - 沟通?Eclipse

2023-09-05 07:09:54 作者:许我一笔墨、绘你倾城颜

我通过以下步骤制成的:统一集成和Eclipse 。我可以调用的函数(我用JavaScript或在Unity C#创建)使用Android SDK和NDK和周围的其他方式?有UnityPlayer和Android SDK和NDK?

I made it by following steps: Integrating Unity and Eclipse. Can I call functions (that I created with JavaScript or C# in Unity) with the Android SDK or NDK and the other way around? There are an interface between UnityPlayer and Android SDK or NDK?

推荐答案

有关的人,这可能帮助:

For whom this may help:

由于@Oli提到的,​​你可以团结的Andr​​oid应用程序的使用这种方法进行通信:

As @Oli mentioned, you can communicate between Unity and an Android app by using this method:

UnityPlayer.UnitySendMessage("GameObjectName1", "MethodName1", "Message to send");

为了使用此方法时,必须按照本指南: http://forum.unity3d.com/threads/71607-Integrating-Uni​​ty-and-Eclipse

您也可以拨打从Unity C#文件的Java方法 - HTTP://docs.unity3d .COM /文档/手动/ Plugins.html

You can also call Java methods from Unity C# file - http://docs.unity3d.com/Documentation/Manual/Plugins.html

您可以使用此code,以启动统一的应用程序后,你作为库添加到您的Andr​​oid项目:

You can use this code in order to start the Unity app after you add it as library to your Android project:

UnityPlayer mPlayer = new UnityPlayer(this); // Put your activity object here
    int glesMode = mPlayer.getSettings().getInt("gles_mode", 1);
    boolean trueColor8888 = false;
    mPlayer.init(glesMode, trueColor8888);

希望这有助于任何人......我已经研究了很多,直到我发现了这个信息。

Hope this helps anyone... I've researched a lot until I found this information.