void Awake() { ui = FindObjectOfType <TargetOnTheFly>(); MarksDirectory = Application.persistentDataPath; Debug.Log("MarkPath:" + Application.persistentDataPath); UnityMessageManager.Instance.OnRNMessage += onMessage; //+=注册事件,-=解绑事件 }
void Awake() { ui = FindObjectOfType <TargetOnTheFly>(); #if UNITY_ANDROID && !UNITY_EDITOR using (var unityPlayerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) using (var currentActivity = unityPlayerClass.GetStatic <AndroidJavaObject>("currentActivity")) using (var file = currentActivity.Call <AndroidJavaObject>("getFilesDir")) { MarksDirectory = file.Call <string>("getAbsolutePath"); } #else MarksDirectory = Application.persistentDataPath; #endif Debug.Log("MarkPath:" + MarksDirectory); Debug.Log("MarkPath:" + Application.persistentDataPath); }
void Awake() { ui = FindObjectOfType <TargetOnTheFly>(); MarksDirectory = Application.persistentDataPath; Debug.Log("MarkPath:" + Application.persistentDataPath); }