コード例 #1
0
        internal void ProcessTouch(ref TouchModel touchState)
        {
            if (!touchState.changedThisFrame)
            {
                return;
            }

            var eventData = GetOrCreateCachedPointerEvent();

            eventData.Reset();

            touchState.CopyTo(eventData);

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

            eventData.button = PointerEventData.InputButton.Left;

            ProcessMouseButton(touchState.selectDelta, eventData, false);
            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;
 }