//Three parameters public virtual void RemoveListener <T, U, V>(string eventType, CENotificationCallback <T, U, V> handler) { if (eventTable.ContainsKey(eventType)) { OnListenerRemoving(eventType, handler); eventTable[eventType] = (CENotificationCallback <T, U, V>)eventTable[eventType] - handler; OnListenerRemoved(eventType); } }
//Three parameters public virtual void Broadcast <T, U, V>(string eventType, T arg1, U arg2, V arg3) { #if LOG_ALL_MESSAGES || LOG_BROADCAST_MESSAGE Debug.Log("MESSENGER\t" + System.DateTime.Now.ToString("hh:mm:ss.fff") + "\t\t\tInvoking \t\"" + eventType + "\""); #endif OnBroadcasting(eventType); Delegate d; if (eventTable.TryGetValue(eventType, out d)) { CENotificationCallback <T, U, V> callback = d as CENotificationCallback <T, U, V>; if (callback != null) { callback(arg1, arg2, arg3); } else { throw CreateBroadcastSignatureException(eventType); } } }
//Three parameters public virtual void AddListener <T, U, V>(string eventType, CENotificationCallback <T, U, V> handler) { OnListenerAdding(eventType, handler); eventTable[eventType] = (CENotificationCallback <T, U, V>)eventTable[eventType] + handler; }