- Home /
Is possible to call a Unity3D function from a Java Android Class?
Hi,
I´ve integrated Unity with Eclipse to do a Android project following this tutorial
http://unity3d.com/support/documentation/Manual/Android-Integrating%20Unity%20With%20Eclipse.html
Integration is working OK, I can call Java methods from Unity but i can´t call Unity Methods from Java Classes..It would be wonderfull if somebody could help me..
Thanks a lot and sorry for my poor english.
Pedro Almagro
Answer by tnetennba · Jun 03, 2011 at 12:55 PM
You can do something like this in Java once you have integrated with eclipse using the SendMessage function.
public class myawesomeanroidapp extends UnityPlayerActivity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
}
public void SendMessageToUnity()
{
UnityPlayer.UnitySendMessage("Main Camera","foo",Integer.toString(fooint));
}
}
Your answer
Follow this Question
Related Questions
[ANDROID]Set Java Plugin on Unity 0 Answers
Android/Unity/Eclipse Help 0 Answers
How to covert Object Array to ImageView? 0 Answers
Unity for Android Eclipse export 1 Answer
back button in Android Activity 1 Answer