コード例 #1
0
ファイル: UIBase.cs プロジェクト: wshhsw2011/MyUnityFrameWork
    public void AddLongPressListener(string compName, InputEventHandle <InputUILongPressEvent> callback, string parm = null)
    {
        InputEventRegisterInfo <InputUILongPressEvent> info = InputUIEventProxy.GetLongPressListener(GetLongPressComp(compName), UIEventKey, compName, parm, callback);

        info.AddListener(GetRegister(m_LongPressEvents, info.eventKey));
        m_LongPressEvents.Add(info);
    }
コード例 #2
0
ファイル: UIBase.cs プロジェクト: zhubuming/MyUnityFrameWork
    public void AddOnDragListener(string compName, InputEventHandle <InputUIOnDragEvent> callback, string parm = null)
    {
        InputEventRegisterInfo <InputUIOnDragEvent> info = InputUIEventProxy.GetOnDragListener(GetDragComp(compName), UIEventKey, compName, parm, callback);

        info.AddListener();
        m_DragEvents.Add(info);
    }
コード例 #3
0
ファイル: UIBase.cs プロジェクト: zhubuming/MyUnityFrameWork
    public void RemoveLongPressListener(string compName, InputEventHandle <InputUILongPressEvent> callback, string parm = null)
    {
        InputEventRegisterInfo <InputUILongPressEvent> info = GetLongPressRegisterInfo(compName, callback, parm);

        m_LongPressEvents.Remove(info);
        info.RemoveListener();
    }
コード例 #4
0
    public void RemoveOnClickListener(string buttonName, InputEventHandle <InputUIOnClickEvent> callback, string parm = null)
    {
        InputEventRegisterInfo <InputUIOnClickEvent> info = GetClickRegisterInfo(buttonName, callback, parm);

        info.RemoveListener();
        m_OnClickEvents.Remove(info);
    }
コード例 #5
0
 public virtual void InitEvent(string UIEventKey)
 {
     m_UIEventKey = UIEventKey;
     m_begionDrag = InputUIEventProxy.GetOnBeginDragListener(m_UIEventKey, name, name, OnBeginDragEvent);
     m_onDrag     = InputUIEventProxy.GetOnDragListener(m_UIEventKey, name, name, OnDragEvent);
     m_endDrag    = InputUIEventProxy.GetOnEndDragListener(m_UIEventKey, name, name, OnEndDragEvent);
 }
コード例 #6
0
    public void DisposeEvent()
    {
        inputUIOnMouseEventDown.RemoveListener();
        inputUIOnMouseEventUp.RemoveListener();

        inputUIOnMouseEventDown = null;
        inputUIOnMouseEventUp   = null;
    }
コード例 #7
0
 public virtual void InitEvent(string UIEventKey)
 {
     m_UIEventKey            = UIEventKey;
     m_begionDrag            = InputUIEventProxy.GetOnBeginDragListener(m_UIEventKey, name, name, OnBeginDragEvent);
     m_onDrag                = InputUIEventProxy.GetOnDragListener(m_UIEventKey, name, name, OnDragEvent);
     m_endDrag               = InputUIEventProxy.GetOnEndDragListener(m_UIEventKey, name, name, OnEndDragEvent);
     inputUIOnMouseEventDown = InputUIEventProxy.GetOnMouseListener(m_UIEventKey, name, name, true, OnMouseDownEvent);
     inputUIOnMouseEventUp   = InputUIEventProxy.GetOnMouseListener(m_UIEventKey, name, name, false, OnMouseUpEvent);
 }
コード例 #8
0
    public static InputEventRegisterInfo <InputUIOnScrollEvent> AddOnScrollListener(string UIName, string ComponentName, InputEventHandle <InputUIOnScrollEvent> callback)
    {
        InputEventRegisterInfo <InputUIOnScrollEvent> info = new InputEventRegisterInfo <InputUIOnScrollEvent>();

        info.eventKey = InputUIOnScrollEvent.GetEventKey(UIName, ComponentName);
        info.callBack = callback;

        InputManager.AddListener <InputUIOnScrollEvent>(
            InputUIOnScrollEvent.GetEventKey(UIName, ComponentName), callback);

        return(info);
    }
コード例 #9
0
    public static InputEventRegisterInfo <InputUIOnEndDragEvent> AddOnEndDragListener(string UIName, string ComponentName, InputEventHandle <InputUIOnEndDragEvent> callback)
    {
        InputEventRegisterInfo <InputUIOnEndDragEvent> info = HeapObjectPool <InputEventRegisterInfo <InputUIOnEndDragEvent> > .GetObject();

        info.eventKey = InputUIOnEndDragEvent.GetEventKey(UIName, ComponentName);
        info.callBack = callback;

        InputManager.AddListener <InputUIOnEndDragEvent>(
            InputUIOnEndDragEvent.GetEventKey(UIName, ComponentName), callback);

        return(info);
    }
コード例 #10
0
    internal static InputEventRegisterInfo <InputUIOnMouseEvent> GetOnMouseListener(string m_UIEventKey, string UIName, string ComponentName, bool isDown, InputEventHandle <InputUIOnMouseEvent> callback)
    {
        InputEventRegisterInfo <InputUIOnMouseEvent> info = HeapObjectPool <InputEventRegisterInfo <InputUIOnMouseEvent> > .GetObject();

        info.eventKey = InputUIOnMouseEvent.GetEventKey(UIName, ComponentName, isDown);
        info.callBack = callback;

        InputManager.AddListener(
            InputUIOnMouseEvent.GetEventKey(UIName, ComponentName, isDown), callback);

        return(info);
    }
コード例 #11
0
ファイル: UIBase.cs プロジェクト: RiyoCoder/MyUnityFrameWork
    public InputEventRegisterInfo <InputUILongPressEvent> GetLongPressRegisterInfo(string compName, InputEventHandle <InputUILongPressEvent> callback, string parm)
    {
        string eventKey = InputUILongPressEvent.GetEventKey(UIName, compName, parm);

        for (int i = 0; i < m_LongPressEvents.Count; i++)
        {
            InputEventRegisterInfo <InputUILongPressEvent> info = (InputEventRegisterInfo <InputUILongPressEvent>)m_LongPressEvents[i];
            if (info.eventKey == eventKey &&
                info.callBack == callback)
            {
                return(info);
            }
        }

        throw new Exception("GetLongPressRegisterInfo Exception not find RegisterInfo by " + compName + " parm " + parm);
    }
コード例 #12
0
ファイル: UIBase.cs プロジェクト: nie341/UnityLockStepDemo
    public void AddOnClickListenerByCreate(Button button, string compName, InputEventHandle <InputUIOnClickEvent> callback, string parm = null)
    {
        InputEventRegisterInfo <InputUIOnClickEvent> info = InputUIEventProxy.AddOnClickListener(button, UIEventKey, compName, parm, callback);

        m_OnClickEvents.Add(info);
    }
コード例 #13
0
ファイル: UIBase.cs プロジェクト: nie341/UnityLockStepDemo
    public void AddOnClickListener(string buttonName, InputEventHandle <InputUIOnClickEvent> callback, string parm = null)
    {
        InputEventRegisterInfo <InputUIOnClickEvent> info = InputUIEventProxy.AddOnClickListener(GetButton(buttonName), UIEventKey, buttonName, parm, callback);

        m_OnClickEvents.Add(info);
    }
コード例 #14
0
 public virtual void InitEvent(string UIEventKey)
 {
     m_UIEventKey            = UIEventKey;
     inputUIOnMouseEventDown = InputUIEventProxy.GetOnMouseListener(m_UIEventKey, name, name, true, OnMouseDownEvent);
     inputUIOnMouseEventUp   = InputUIEventProxy.GetOnMouseListener(m_UIEventKey, name, name, false, OnMouseUpEvent);
 }
コード例 #15
0
 public virtual void Init(string UIEventKey)
 {
     m_UIEventKey = UIEventKey;
     m_register   = InputUIEventProxy.AddOnScrollListener(m_UIEventKey, name, OnSetContentAnchoredPosition);
 }