示例#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)
        {
            bool value = UnityInputHelper.GetJoystickButtonValueByJoystickIndex(joystickID, inputIndex);

            if (!value)
            {
                return;
            }

            foreach (int inputID in inputIDs)
            {
                vrControllers.SetButtonValueById(inputID, value);
            }
        }
示例#3
0
        internal override void UpdateValues(CustomController vrController)
        {
            bool isReleasing = false;

            if (buttonAction.state)
            {
                canRelease = Time.realtimeSinceStartup - buttonAction.changedTime < 0.4f;
            }
            else
            {
                isReleasing = canRelease && Time.realtimeSinceStartup - buttonAction.changedTime < 0.1f;
            }

            vrController.SetButtonValueById(buttonID, isReleasing);
        }
示例#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);
            }
        }
    public void OnRewiredInputUpdate()
    {
        //if(swipeToCycle)
        //controller.SetButtonValueById(6, swipedDown || Input.GetKey(KeyCode.L));

        if (levelDone)
        {
            controller.SetButtonValueById(3, false);
            controller.SetAxisValueById(2, 0);
            controller.SetAxisValueById(0, 0);
            controller.SetAxisValueById(1, 0);
        }
        else
        {
            controller.SetAxisValueById(2, lookInput);
            controller.SetAxisValueById(0, moveX);
            controller.SetAxisValueById(1, moveY);
        }
    }
示例#6
0
 internal override void UpdateValues(CustomController vrController)
 {
     vrController.SetButtonValueById(buttonID, buttonAction.state || (holdableButtonAction.state && Time.realtimeSinceStartup - holdableButtonAction.changedTime > 0.4f));
 }
示例#7
0
 internal override void UpdateValues(CustomController vrController)
 {
     vrController.SetButtonValueById(buttonID, buttonAction.state);
 }
示例#8
0
 void OnInputUpdate()
 {
     controller.SetButtonValueById(rewiredButtonId, isShooting);
 }