public static void StopListening(string eventName, UnityAction <object, object> listener) { if (eventManager == null) { return; } UnityTwoArgsEvent thisEvent = null; if (instance.eventTwoArgsDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.RemoveListener(listener); } }
public static void StopListening(string eventName, UnityAction <object, object> listener) { if (eventManager == null) { return; // In case we've already destroyed our eventManager, avoid exceptions. } UnityTwoArgsEvent thisEvent = null; if (instance.eventTwoArgsDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.RemoveListener(listener); } }