Esempio n. 1
0
 void OnDestroy()
 {
     if (this != Instance)
     {
         return;
     }
     Instance = null;
     Running  = false;
     GameEvents.onLevelWasLoadedGUIReady.Remove(onLevelLoaded);
     GameEvents.onGameSceneLoadRequested.Remove(onGameSceneLoad);
 }
 void Awake()
 {
     if (Instance != null)
     {
         Destroy(gameObject);
         return;
     }
     Instance = this;
     GameEvents.onLevelWasLoadedGUIReady.Add(onLevelLoaded);
     GameEvents.onGameSceneLoadRequested.Add(onGameSceneLoad);
 }
 void OnDestroy()
 {
     Instance = null;
     GameEvents.onLevelWasLoadedGUIReady.Remove(onLevelLoaded);
     GameEvents.onGameSceneLoadRequested.Remove(onGameSceneLoad);
 }