public static void TriggerEvent(string eventName, int value) { IntArgEvent thisEvent = null; if (instance.eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.Invoke(value); } }
public static void StopListening(string eventName, UnityAction <int> listener) { if (eventManagerIntArg == null) { return; } IntArgEvent thisEvent = null; if (instance.eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.RemoveListener(listener); } }
public static void StartListening(string eventName, UnityAction <int> listener) { IntArgEvent thisEvent = null; if (instance.eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.AddListener(listener); } else { thisEvent = new IntArgEvent(); thisEvent.AddListener(listener); instance.eventDictionary.Add(eventName, thisEvent); } }