Пример #1
0
    public static void TriggerBoolEvent(string eventName, bool input)
    {
        UnityBoolEvent thisEvent = null;

        if (instance.boolEventDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.Invoke(input);
        }
    }
Пример #2
0
    public static void StopListeningTypeBool(string eventName, UnityAction <bool> listener)
    {
        if (eventManager == null)
        {
            return;
        }
        UnityBoolEvent thisEvent = null;

        if (instance.boolEventDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.RemoveListener(listener);
        }
    }
Пример #3
0
    //--End Int Int Event methods--

    //Bool based event setup (Ended up not using these for the time being)
    public static void StartListeningTypeBool(string eventName, UnityAction <bool> listener)
    {
        UnityBoolEvent thisEvent = null;

        if (instance.boolEventDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.AddListener(listener);
        }
        else
        {
            thisEvent = new UnityBoolEvent();
            thisEvent.AddListener(listener);
            instance.boolEventDictionary.Add(eventName, thisEvent);
        }
    }