Integration of Oneness with Eclipse - Communication?

I did this by following these steps: Integrating Unity and Eclipse . Can I call functions (which I created using JavaScript or C # in Unity) with the Android SDK or NDK and vice versa? Is there an interface between UnityPlayer and the Android SDK or NDK?

+6
source share
2 answers

For whom it can help:

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

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

For this method to work, you must follow this guide: http://forum.unity3d.com/threads/71607-Integrating-Unity-and-Eclipse

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

This code can be used to launch a Unity application after adding it as a library to an 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 researched a lot until I found this information.

+4
source

Not. You cannot call JavaScript or C # functions in Eclipse. On the contrary, you can use the native android functions in unit3d by integrating Unity with Eclipse.

0
source

Source: https://habr.com/ru/post/907764/


All Articles