public static void TriggerEvent(string eventName, Route param) { UnityEventRoute thisEvent = null; if (Instance != null && Instance.eventDictionaryRoute.TryGetValue(eventName, out thisEvent)) { thisEvent.Invoke(param); } }
public static void StopListeningClass(string eventName, UnityAction <Route> listener) { if (Instance == null) { return; } UnityEventRoute thisEvent = null; if (Instance.eventDictionaryRoute.TryGetValue(eventName, out thisEvent)) { thisEvent.RemoveListener(listener); } }
public static void StartListeningClass(string eventName, UnityAction <Route> listener) { UnityEventRoute thisEvent = null; if (Instance.eventDictionaryRoute.TryGetValue(eventName, out thisEvent)) { thisEvent.AddListener(listener); } else { thisEvent = new UnityEventRoute(); thisEvent.AddListener(listener); Instance.eventDictionaryRoute.Add(eventName, thisEvent); } }