private void Awake() { if (Instance == null) { DontDestroyOnLoad(gameObject); SceneManager.sceneLoaded += OnLevelFinishedLoading; Instance = this; } }
public void Destroy() { SceneManager.sceneLoaded -= OnLevelFinishedLoading; Instance = null; Destroy(gameObject); }