示例#1
0
        internal override void UpdateValues(CustomController vrControllers)
        {
            bool state = UnityInputHelper.GetJoystickButtonValueByJoystickIndex(joystickID, inputIndex);

            bool isReleasing = false;

            if (state != lastState)
            {
                lastChangeTime = Time.realtimeSinceStartup;
                lastState      = state;
            }

            float timeSinceLastChange = Time.realtimeSinceStartup - lastChangeTime;

            if (state)
            {
                canRelease = timeSinceLastChange < 0.4f;
            }
            else
            {
                isReleasing = canRelease && timeSinceLastChange < 0.1f;
            }

            if (state)
            {
                vrControllers.SetButtonValueById(inputIDs[0], state);
            }

            if (isReleasing)
            {
                vrControllers.SetButtonValueById(inputIDs[1], isReleasing);
            }
        }
示例#2
0
        internal override void UpdateValues(CustomController vrControllers)
        {
            float value = UnityInputHelper.GetJoystickAxisRawValueByJoystickIndex(joystickID, inputIndex);

            if (invert)
            {
                value = -value;
            }

            foreach (int inputID in inputIDs)
            {
                vrControllers.SetAxisValueById(inputID, value);
            }
        }
示例#3
0
        internal override void UpdateValues(CustomController vrControllers)
        {
            bool value = UnityInputHelper.GetJoystickButtonValueByJoystickIndex(joystickID, inputIndex);

            if (!value)
            {
                return;
            }

            foreach (int inputID in inputIDs)
            {
                vrControllers.SetButtonValueById(inputID, value);
            }
        }
示例#4
0
        internal override void UpdateValues(CustomController vrControllers)
        {
            float value = UnityInputHelper.GetJoystickAxisRawValueByJoystickIndex(joystickID, inputIndex);

            bool state = value > 0.7f;

            if (!state)
            {
                return;
            }

            foreach (int inputID in inputIDs)
            {
                vrControllers.SetButtonValueById(inputID, state);
            }
        }