private void Awake() { Instance = this; _highestScore = PlayerPrefs.GetInt(HighestScorePrefKey, 0); OnLevelCompletedEvent.AddListener(OnLevelCompleted); OnLevelResultEvent.AddListener(OnLevelResult); }
private void OnDestroy() { OnLevelCompletedEvent.RemoveAllListeners(); OnOpenLevelsPopUp.RemoveAllListeners(); OnPlayLevelButtonEvent.RemoveAllListeners(); OnInitializeLevelEvent.RemoveAllListeners(); OnLevelResultEvent.RemoveAllListeners(); OnReturnMainMenu.RemoveAllListeners(); OnGameHudUpdateEvent.RemoveAllListeners(); }