public static void StopListening(string eventName, UnityAction listener) { if (levelEventHandler == null) { return; } LevelEvent thisEvent = null; if (instance.eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.RemoveListener(listener); } }
void WaitForLoad(Level level) { Debug.Log("Waiting..."); GoToNextLevel(); OnLevelLoaded.RemoveListener(WaitForLoad); }