Ejemplo n.º 1
0
 public void Call(InputUIOnBeginDragEvent param0)
 {
     func.BeginPCall();
     func.PushObject(param0);
     func.PCall();
     func.EndPCall();
 }
 public static void DispatchBeginDragEvent(string UIName, string ComponentName, string parm = "")
 {
     //只有允许输入时才派发事件
     if (IsActive)
     {
         InputUIOnBeginDragEvent e = GetUIEvent <InputUIOnBeginDragEvent>(UIName, ComponentName, parm);
         InputManager.Dispatch("InputUIOnBeginDragEvent", e);
     }
 }
 public static void DispatchBeginDragEvent(string UIName, string ComponentName)
 {
     //只有允许输入时才派发事件
     if (IsActive)
     {
         InitPool();
         InputUIOnBeginDragEvent e = GetBeginDragEvent(UIName, ComponentName);
         InputManager.Dispatch <InputUIOnBeginDragEvent>(e);
     }
 }
 public static void DispatchBeginDragEvent(string UIName, string ComponentName, string parm, PointerEventData data)
 {
     //只有允许输入时才派发事件
     if (IsActive)
     {
         InputUIOnBeginDragEvent e = GetUIEvent <InputUIOnBeginDragEvent>(UIName, ComponentName, parm);
         e.m_dragPosition = data.position;
         e.m_delta        = data.delta;
         InputManager.Dispatch("InputUIOnBeginDragEvent", e);
     }
 }
Ejemplo n.º 5
0
 private void OnBeginDrag(InputUIOnBeginDragEvent e)
 {
     if (m_moveDict.ContainsKey(e.m_compName))
     {
         m_moveDict[e.m_compName] = true;
     }
     else
     {
         m_moveDict.Add(e.m_compName, true);
     }
 }
    public static InputEventRegisterInfo <InputUIOnBeginDragEvent> AddOnBeginDragListener(string UIName, string ComponentName, InputEventHandle <InputUIOnBeginDragEvent> callback)
    {
        InputEventRegisterInfo <InputUIOnBeginDragEvent> info = HeapObjectPool <InputEventRegisterInfo <InputUIOnBeginDragEvent> > .GetObject();

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

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

        return(info);
    }
Ejemplo n.º 7
0
    public static InputBeginDragRegisterInfo GetOnBeginDragListener(DragAcceptor acceptor, string UIName, string ComponentName, string parm, InputEventHandle <InputUIOnBeginDragEvent> callback)
    {
        InputBeginDragRegisterInfo info = HeapObjectPool <InputBeginDragRegisterInfo> .GetObject();

        info.eventKey      = InputUIOnBeginDragEvent.GetEventKey(UIName, ComponentName);
        info.callBack      = callback;
        info.m_acceptor    = acceptor;
        info.m_OnBeginDrag = (data) =>
        {
            DispatchBeginDragEvent(UIName, ComponentName, parm, data);
        };

        return(info);
    }
    static InputUIOnBeginDragEvent GetBeginDragEvent(string UIName, string ComponentName)
    {
        InputUIOnBeginDragEvent msg = m_beginDragPool[m_beginDragIndex];

        msg.Reset();

        msg.m_name     = UIName;
        msg.m_compName = ComponentName;

        m_beginDragIndex++;

        if (m_beginDragIndex >= m_beginDragPool.Length)
        {
            m_beginDragIndex = 0;
        }

        return(msg);
    }
    static void InitPool()
    {
        if (!isInit)
        {
            isInit       = true;
            m_scrollPool = new InputUIOnScrollEvent[c_clickPoolSize];
            for (int i = 0; i < c_clickPoolSize; i++)
            {
                m_scrollPool[i] = new InputUIOnScrollEvent();
            }

            m_clickPool = new InputUIOnClickEvent[c_srollPoolSize];
            for (int i = 0; i < c_srollPoolSize; i++)
            {
                m_clickPool[i] = new InputUIOnClickEvent();
            }

            m_dragPool = new InputUIOnDragEvent[c_dragPoolSize];
            for (int i = 0; i < c_dragPoolSize; i++)
            {
                m_dragPool[i] = new InputUIOnDragEvent();
            }

            m_beginDragPool = new InputUIOnBeginDragEvent[c_beginDragPoolSize];
            for (int i = 0; i < c_beginDragPoolSize; i++)
            {
                m_beginDragPool[i] = new InputUIOnBeginDragEvent();
            }

            m_endDragPool = new InputUIOnEndDragEvent[c_endDragPoolSize];
            for (int i = 0; i < c_endDragPoolSize; i++)
            {
                m_endDragPool[i] = new InputUIOnEndDragEvent();
            }
        }
    }
Ejemplo n.º 10
0
 public virtual void OnBeginDragEvent(InputUIOnBeginDragEvent inputEvent)
 {
 }
Ejemplo n.º 11
0
 void OnBeginDrag(InputUIOnBeginDragEvent e)
 {
     Debug.Log("开始拖拽...." + e.m_dragPosition);
 }