Exemplo n.º 1
0
 public void AddUIEventListener(GameObject obj, eUIEventType type, UIEventListener.EventDelegate callBack)
 {
     if (obj == null)
     {
         return;
     }
     UIEventListener.Get(obj).AddEventListener(type, callBack);
 }
Exemplo n.º 2
0
    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);
        }
    }
Exemplo n.º 3
0
 public void RemoveEventListener(eUIEventType type, EventDelegate callback)
 {
     this.UIEventHandleList[(int)type] -= callback;
 }
Exemplo n.º 4
0
 public void ClearEventListener(eUIEventType type)
 {
     this.UIEventHandleList[(int)type] = null;
 }
Exemplo n.º 5
0
 public void RemoveUIEventListener(string obj_name, eUIEventType type, UIEventListener.EventDelegate callBack)
 {
     RemoveUIEventListener(GameObjectUtils.GetChildWithName(obj_name, transform).gameObject, type, callBack);
 }