Ejemplo n.º 1
0
    public static void TriggerEvent(GameEvent eventName, Hashtable eventArgs = default(Hashtable))
    {
        ParametrizedEvent thisEvent = null;

        if (instance.eventDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.Invoke(eventArgs);
        }
    }
Ejemplo n.º 2
0
    public static void StopListening(GameEvent eventName, UnityAction <Hashtable> listener)
    {
        if (eventManager == null)
        {
            return;
        }
        ParametrizedEvent thisEvent = null;

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

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