void Awake() { DontDestroyOnLoad(this); m_Inst = (CommunicateWithJava)(MonoBehaviour)this; #if PLATFORM_ANDROID_SDK && CHANNEL_FACEBOOK #else if (Application.platform == RuntimePlatform.Android) { m_AJClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); m_AJObj = m_AJClass.GetStatic <AndroidJavaObject>("currentActivity"); } #endif }
void OnDestroy() { m_Inst = null; }