/// <summary>
 /// The object has been enabled.
 /// </summary>
 private void OnEnable()
 {
     // The object may have been enabled outside of the scene unloading.
     if (s_Instance == null)
     {
         s_Instance    = this;
         s_Initialized = true;
         SceneManager.sceneUnloaded -= SceneUnloaded;
     }
 }
 private static void DomainReset()
 {
     s_Initialized = false;
     s_Instance    = null;
 }
Exemple #3
0
 /// <summary>
 /// Removes the spawn point from the manager.
 /// </summary>
 private void OnDisable()
 {
     SpawnPointManager.RemoveSpawnPoint(this);
 }
 /// <summary>
 /// Reset the initialized variable when the scene is no longer loaded.
 /// </summary>
 /// <param name="scene">The scene that was unloaded.</param>
 private void SceneUnloaded(Scene scene)
 {
     s_Initialized = false;
     s_Instance    = null;
     SceneManager.sceneUnloaded -= SceneUnloaded;
 }
Exemple #5
0
 /// <summary>
 /// Adds the spawn point to the manager.
 /// </summary>
 private void OnEnable()
 {
     SpawnPointManager.AddSpawnPoint(this);
 }