Beispiel #1
0
    public static void StartListeningGo(string eventName, UnityAction <GameObject> listener)
    {
        UnityEventGo thisEvent = null;

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