Exemplo n.º 1
0
 private void Awake()
 {
     if (Instance == null)
     {
         DontDestroyOnLoad(gameObject);
         SceneManager.sceneLoaded += OnLevelFinishedLoading;
         Instance = this;
     }
 }
Exemplo n.º 2
0
 public void Destroy()
 {
     SceneManager.sceneLoaded -= OnLevelFinishedLoading;
     Instance = null;
     Destroy(gameObject);
 }