Ejemplo n.º 1
0
    public static void StartListeningObj(string eventName, UnityAction <GameObject> listener)
    {
        ObjEvent thisObjEvent = null;

        if (instance.ObjEventDictionary.TryGetValue(eventName, out thisObjEvent))
        {
            thisObjEvent.AddListener(listener);
        }
        else
        {
            thisObjEvent = new ObjEvent();
            thisObjEvent.AddListener(listener);
            instance.ObjEventDictionary.Add(eventName, thisObjEvent);
        }
    }
Ejemplo n.º 2
0
    public static void StartListening(ParameterizedGameEvent eventName, UnityAction <object> listener)
    {
        ObjEvent thisEvent = null;

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