コード例 #1
0
    public void RegisterForPointerEvent(IInputListener listener, ePointerEvent PointerEvent)
    {
        switch (PointerEvent)
        {
        case ePointerEvent.OnPointerDown: if (PointerDownCalls.Contains(listener))
            {
                return;
            }
            PointerDownCalls.Add(listener); break;

        case ePointerEvent.OnPointerUp: if (PointerUpCalls.Contains(listener))
            {
                return;
            }
            PointerUpCalls.Add(listener); break;

        case ePointerEvent.OnPointerMove: if (PointerMoveCalls.Contains(listener))
            {
                return;
            }
            PointerMoveCalls.Add(listener); break;

        case ePointerEvent.OnPointerClick: if (PointerClickCalls.Contains(listener))
            {
                return;
            }
            PointerClickCalls.Add(listener); break;

        case ePointerEvent.OnPointerDoubleClick: if (PointerDoubleClickCalls.Contains(listener))
            {
                return;
            }
            PointerDoubleClickCalls.Add(listener); break;

        case ePointerEvent.OnPointerHoldStart: if (PointerHoldStartCalls.Contains(listener))
            {
                return;
            }
            PointerHoldStartCalls.Add(listener); break;

        case ePointerEvent.OnPointerHoldUpdate: if (PointerHoldUpdateCalls.Contains(listener))
            {
                return;
            }
            PointerHoldUpdateCalls.Add(listener); break;

        case ePointerEvent.OnPointerHoldEnd: if (PointerHoldEndCalls.Contains(listener))
            {
                return;
            }
            PointerHoldEndCalls.Add(listener); break;

        case ePointerEvent.OnPointerSwipeStart: if (PointerSwipeStartCalls.Contains(listener))
            {
                return;
            }
            PointerSwipeStartCalls.Add(listener); break;

        case ePointerEvent.OnPointerSwipeUpdate: if (PointerSwipeUpdateCalls.Contains(listener))
            {
                return;
            }
            PointerSwipeUpdateCalls.Add(listener); break;

        case ePointerEvent.OnPointerSwipeEnd: if (PointerSwipeEndCalls.Contains(listener))
            {
                return;
            }
            PointerSwipeEndCalls.Add(listener); break;
        }
        BootRegistrationCoroutine();
    }
コード例 #2
0
    public void UnRegisterForPointerEvent(IInputListener listener, ePointerEvent PointerEvent)
    {
        switch (PointerEvent)
        {
        case ePointerEvent.OnPointerDown: if (PointerDownCalls.Contains(listener))
            {
                PointerDownCalls.Remove(listener);
            }
            break;

        case ePointerEvent.OnPointerUp: if (PointerUpCalls.Contains(listener))
            {
                PointerUpCalls.Remove(listener);
            }
            break;

        case ePointerEvent.OnPointerMove: if (PointerMoveCalls.Contains(listener))
            {
                PointerMoveCalls.Remove(listener);
            }
            break;

        case ePointerEvent.OnPointerClick: if (PointerClickCalls.Contains(listener))
            {
                PointerClickCalls.Remove(listener);
            }
            break;

        case ePointerEvent.OnPointerDoubleClick: if (PointerDoubleClickCalls.Contains(listener))
            {
                PointerDoubleClickCalls.Remove(listener);
            }
            break;

        case ePointerEvent.OnPointerHoldStart: if (PointerHoldStartCalls.Contains(listener))
            {
                PointerHoldStartCalls.Remove(listener);
            }
            break;

        case ePointerEvent.OnPointerHoldUpdate: if (PointerHoldUpdateCalls.Contains(listener))
            {
                PointerHoldUpdateCalls.Remove(listener);
            }
            break;

        case ePointerEvent.OnPointerHoldEnd: if (PointerHoldEndCalls.Contains(listener))
            {
                PointerHoldEndCalls.Remove(listener);
            }
            break;

        case ePointerEvent.OnPointerSwipeStart: if (PointerSwipeStartCalls.Contains(listener))
            {
                PointerSwipeStartCalls.Remove(listener);
            }
            break;

        case ePointerEvent.OnPointerSwipeUpdate: if (PointerSwipeUpdateCalls.Contains(listener))
            {
                PointerSwipeUpdateCalls.Remove(listener);
            }
            break;

        case ePointerEvent.OnPointerSwipeEnd: if (PointerSwipeEndCalls.Contains(listener))
            {
                PointerSwipeEndCalls.Remove(listener);
            }
            break;
        }
    }