public static void RegistEvent(EVENTTYPE eventType, EVENTID eventID, UnityAction action) { if (dic.Get(eventType, eventID) == default(UnityEvent)) { dic.Set(eventType, eventID, new UnityEvent()); } dic.Get(eventType, eventID).AddListener(action); }
public static void PostEvent(EVENTTYPE eventType, EVENTID eventID) { var unityEvent = dic.Get(eventType, eventID); if (unityEvent != default(UnityEvent)) { unityEvent.Invoke(); } else { Debug.Log("Function is not exist!"); } }