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(); }
public TouchResponder(int pointerId, InputActionProperty position, InputActionProperty phase) { actionCallback = null; m_ActionsHooked = false; state = new TouchModel(pointerId); m_Position = position; m_Phase = phase; }