Exemplo n.º 1
0
 public TrackedDeviceResponder(int pointerId, InputActionProperty position, InputActionProperty orientation, InputActionProperty select)
 {
     actionCallback  = null;
     m_ActionsHooked = false;
     state           = new TrackedDeviceModel(pointerId);
     m_Position      = position;
     m_Orientation   = orientation;
     m_Select        = select;
 }
Exemplo n.º 2
0
        internal void ProcessTrackedDevice(ref TrackedDeviceModel deviceState)
        {
            if (!deviceState.changedThisFrame)
            {
                return;
            }

            var eventData = GetOrCreateCachedTrackedPointerEvent();

            eventData.Reset();
            deviceState.CopyTo(eventData);

            eventData.button = PointerEventData.InputButton.Left;
            eventData.pointerCurrentRaycast = PerformRaycast(eventData);

            ProcessMouseButton(deviceState.selectDelta, eventData);
            ProcessMouseMovement(eventData);
            ProcessMouseButtonDrag(eventData, trackedDeviceDragThresholdMultiplier);

            deviceState.CopyFrom(eventData);

            deviceState.OnFrameFinished();
        }