public void AddUIEventListener(GameObject obj, eUIEventType type, UIEventListener.EventDelegate callBack) { if (obj == null) { return; } UIEventListener.Get(obj).AddEventListener(type, callBack); }
private void OnHandler(eUIEventType type, BaseEventData eventData) { if (!Interactable) { return; } EventDelegate handle = UIEventHandleList[(int)type]; if (handle != null) { UIEvent args = new UIEvent(); args.type = type; args.target = gameObject; args.data = eventData; handle(args); } }
public void RemoveEventListener(eUIEventType type, EventDelegate callback) { this.UIEventHandleList[(int)type] -= callback; }
public void ClearEventListener(eUIEventType type) { this.UIEventHandleList[(int)type] = null; }
public void RemoveUIEventListener(string obj_name, eUIEventType type, UIEventListener.EventDelegate callBack) { RemoveUIEventListener(GameObjectUtils.GetChildWithName(obj_name, transform).gameObject, type, callBack); }