Android 代码在Unity中的层级调用

来源:互联网 发布:codecademy python 编辑:程序博客网 时间:2024/05/16 11:39

在Java中的代码

public class Player {public int index = 12321321;public void GetTest(){Log.v("Unity", "setListener(1)!------------");}}

        activity.Call<AndroidJavaObject>("Test").Call("GetTest");        int index = activity.Call<AndroidJavaObject>("Test").Get<int>("index");        UnityEngine.Debug.LogError("index : === " + index);

可以看到当返回AndroidJavaObject的话,还可以继续通过这个对象继续往下调用里面的方法和变量

0 0