Ejemplo n.º 1
0
 void OnDisable()
 {
     if (sInstance == this)
     {
         sInstance = null;
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a gameobject for use with UnitySendMessage from native side.
 /// Must be called from Unity game thread.
 /// </summary>
 internal static AndroidNotificationListener GetListener()
 {
     if (sInstance == null)
     {
         var go = new GameObject(ANDROID_NOTIFICATION_LISTENER_GAMEOBJECT);
         go.hideFlags = HideFlags.HideAndDontSave;
         sInstance    = go.AddComponent <AndroidNotificationListener>();
         DontDestroyOnLoad(go);
     }
     return(sInstance);
 }