Beispiel #1
0
    // We must take care of memory leaks, and unsubscribe.
    public static void StopListening(string eventName, UnityAction <ItemButton> listener)
    {
        //  If there is no eventManager in scene, we have nothing to worry about, and just leave method.
        if (eventManager == null)
        {
            return;
        }

        CustomEventWithItemButtonParameter thisEvent = null;

        if (Instance.eventDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.RemoveListener(listener);
        }
    }