参考资料1 里面的 项目
要从Android 回调到 unity的脚本
unity的testManager.cs脚本 必须挂载到当前场景 的一个 实体gameObject上,
且当前场景为Scenes In Build里面的场景。
Unity编辑器
testManager.cs
...
public class testManager : MonoBehaviour
...
public void test1(string str)//正解
{
Debug.Log("从安卓回调1 :"+str);
}
public static void test2(string str)//错误
{
Debug.Log("从安卓回调2 :"+str);
}
...
.java里面的测试
callUnity("testGameObject","test1", "测试回调1");//有回调
callUnity("testGameObject","test2", "测试回调2");//无回调
参考资料:
2.