Beispiel #1
0
        protected virtual void ReadInput()
        {
            DepressedButtons = 0;
            ScrollDelta      = Vector2.zero;

            if (!nodeState.tracked)
            {
                return;
            }

            var leftClick = VRInput.GetAxis(nodeState, InputAxis.MainTrigger);

            if (leftClick > .9f)
            {
                DepressedButtons |= MouseButton.Left;
            }

            var rightClick = VRInput.GetAxis(nodeState, InputAxis.Grip);

            if (rightClick > .5f)
            {
                DepressedButtons |= MouseButton.Right;
            }

            switch (VRInput.GetJoypadType(nodeState))
            {
            case JoyPadType.Joystick:
                ReadJoystick();
                break;

            case JoyPadType.TouchPad:
                ReadTouchpad();
                break;
            }
        }