public static void RemoveInvoker(EventsNames eventName, IntEventInvoker intInvoker) { if (invokers.ContainsKey(eventName)) { invokers[eventName].Remove(intInvoker); } }
public static void AddInvoker(EventsNames eventName, IntEventInvoker intInvoker) { foreach (UnityAction <int> listener in listeners[eventName]) { intInvoker.AddListener(eventName, listener); } invokers[eventName].Add(intInvoker); }
/// <summary> /// Adds the given invoker for the given event name /// </summary> /// <param name="eventName">event name</param> /// <param name="invoker">invoker</param> public static void AddInvoker(EventName eventName, IntEventInvoker invoker) { // add listeners to new invoker and add new invoker to dictionary foreach (UnityAction <int> listener in listeners[eventName]) { invoker.AddListener(eventName, listener); } invokers[eventName].Add(invoker); }
public static void AddEventInvoker(EventName @event, IntEventInvoker invoker) { // Add all existing listeners for that event to the new invoker foreach (UnityAction <int> listener in listeners[@event]) { invoker.AddListener(@event, listener); } // Add the invoker to the invokers list of that event invokers[@event].Add(invoker); }
/// <summary> /// Removes the given invoker for the given event name /// </summary> /// <param name="eventName">event name</param> /// <param name="invoker">invoker</param> public static void RemoveInvoker(EventName eventName, IntEventInvoker invoker) { // remove invoker from dictionary invokers[eventName].Remove(invoker); }
public static void RemoveEventInvoker(EventName @event, IntEventInvoker invoker) { invokers[@event].Remove(invoker); }
public static void RemoveInvoker(EventName eventName, IntEventInvoker invoker) { invokers[eventName].Remove(invoker); }