public void OnDisable()
 {
     if (instance == this)
     {
         instance = null;
     }
 }
Esempio n. 2
0
 // Call this once from the game thread
 public static void CreateObject() {
     if (instance != null) {
         return;
     }
     if (Application.isPlaying) {
         // add an invisible game object to the scene
         GameObject obj = new GameObject("PlayGames_QueueRunner");
         DontDestroyOnLoad(obj);
         instance = obj.AddComponent<PlayGamesHelperObject>();
     } else {
         instance = new PlayGamesHelperObject();
         sIsDummy = true;
     }
 }
Esempio n. 3
0
        // Call this once from the game thread
        public static void CreateObject()
        {
            if (instance != null)
            {
                return;
            }

            if (Application.isPlaying)
            {
                // add an invisible game object to the scene
                GameObject obj = new GameObject("PlayGames_QueueRunner");
                DontDestroyOnLoad(obj);
                instance = obj.AddComponent <PlayGamesHelperObject>();
            }
            else
            {
                instance = new PlayGamesHelperObject();
                sIsDummy = true;
            }
        }