public static void Init() { #if UNITY_ANDROID Debug.Log("Moga Init"); AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); if (jc == null) { Debug.Log("unity player not found"); return; } AndroidJavaObject activity = jc.GetStatic <AndroidJavaObject>("currentActivity"); if (activity == null) { Debug.Log("current activity not found"); return; } AndroidJavaObject controller = MogaWrapper.getInstance(activity); if (controller == null) { Debug.Log("moga controller not found"); return; } m_MogaController = new MogaWrapper(controller); m_MogaController.init(); #endif }
public static void Done() { #if UNITY_ANDROID Debug.Log("Moga Done"); m_MogaController.exit(); m_MogaController = null; #endif }