예제 #1
0
        internal void ProcessTouch(ref TouchModel touchState)
        {
            if (!touchState.changedThisFrame)
            {
                return;
            }

            var eventData = GetOrCreateCachedPointerEvent();

            eventData.Reset();

            touchState.CopyTo(eventData);

            if (touchState.selectPhase == PointerPhase.Cancelled)
            {
                eventData.pointerCurrentRaycast = (touchState.selectPhase == PointerPhase.Cancelled) ? new RaycastResult() : PerformRaycast(eventData);
            }
            else
            {
                eventData.pointerCurrentRaycast = PerformRaycast(eventData);
            }

            eventData.button = PointerEventData.InputButton.Left;

            ProcessMouseButton(touchState.selectDelta, eventData);
            ProcessMouseMovement(eventData);
            ProcessMouseButtonDrag(eventData);

            touchState.CopyFrom(eventData);

            touchState.OnFrameFinished();
        }
예제 #2
0
 public TouchResponder(int pointerId, InputActionProperty position, InputActionProperty phase)
 {
     actionCallback  = null;
     m_ActionsHooked = false;
     state           = new TouchModel(pointerId);
     m_Position      = position;
     m_Phase         = phase;
 }