Assets/Scripts/System/EventProcessor.cs
/// <summary>
/// Adds the passed in listener method to the event dictionary.
/// </summary>
/// <param name="eventName">The event being referenced.</param>
/// <param name="listener">The listener method you would like to subscribe.</param>
Adds the passed in listener method to the event dictionary.
Adds the passed in listener method to the event dictionary .
public void StartListening(string eventName, UnityAction<object> listener)
    {
        UnityEvent<object> newEvent = null;
        if (eventDictionary.TryGetValue(eventName, out newEvent))
        {
            newEvent.AddListener(listener);
        }
        else
        {
            newEvent = new UnityEvent<object>();
            newEvent.AddListener(listener);
            eventDictionary.Add(eventName, newEvent);
        }
    }
public void StartListening ( string eventName , UnityAction < object > listener ) { UnityEvent < object > newEvent = null ; if ( eventDictionary . TryGetValue ( eventName , out newEvent ) ) { newEvent . AddListener ( listener ) ; } else { newEvent = new UnityEvent < object > ( ) ; newEvent . AddListener ( listener ) ; eventDictionary . Add ( eventName , newEvent ) ; } }
Adds the passed in listener method to the event dictionary.
Adds the passed in listener method to the event dictionary .
eventName
string
The event being referenced.
The event being referenced .
listener
UnityAction<object>
The listener method you would like to subscribe.
The listener method you would like to subscribe .