Exemplo n.º 1
0
    public static void TriggerEvent(string eventName, string json)
    {
        EnhancedEvent thisEvent = null;

        if (instance.eventDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.Invoke(json);
        }
    }
Exemplo n.º 2
0
    public static void StopListening(string eventName, UnityAction <string> listener)
    {
        if (eventManager == null)
        {
            return;
        }
        EnhancedEvent thisEvent = null;

        if (instance.eventDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.RemoveListener(listener);
        }
    }
Exemplo n.º 3
0
    public static void StartListening(string eventName, UnityAction <string> listener)
    {
        EnhancedEvent thisEvent = null;

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