public static void Broadcast <T, X, Y, Z>(DFEventType eventType, T arg1, X arg2, Y arg3, Z arg4) { Delegate d; if (m_EventTable.TryGetValue(eventType, out d)) { DFCallBack <T, X, Y, Z> callBack = d as DFCallBack <T, X, Y, Z>; if (callBack != null) { callBack(arg1, arg2, arg3, arg4); } else { throw new Exception("Broadcast Error: the callBack is null![" + eventType + "]"); } } }
public static void Broadcast(DFEventType eventType) { Delegate d; if (m_EventTable.TryGetValue(eventType, out d)) { DFCallBack callBack = d as DFCallBack; if (callBack != null) { callBack(); } else { throw new Exception("Broadcast Error: the callBack is null!"); } } }
public static void RemoveListener <T, X, Y, Z>(DFEventType eventType, DFCallBack <T, X, Y, Z> callBack) { IRemoveListener(eventType, callBack); m_EventTable[eventType] = (DFCallBack <T, X, Y, Z>)m_EventTable[eventType] - callBack; }
public static void AddListener <T, X, Y, Z>(DFEventType eventType, DFCallBack <T, X, Y, Z> callBack) { IAddListener(eventType, callBack); m_EventTable[eventType] = (DFCallBack <T, X, Y, Z>)m_EventTable[eventType] + callBack; }
public static void AddListener(DFEventType eventType, DFCallBack callBack) { IAddListener(eventType, callBack); m_EventTable[eventType] = (DFCallBack)m_EventTable[eventType] + callBack; }