Beispiel #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);
            }
        }
Beispiel #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);
            }
        }
        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);
        }
Beispiel #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);
        }
    }
Beispiel #6
0
 internal override void UpdateValues(CustomController vrController)
 {
     vrController.SetButtonValueById(buttonID, buttonAction.state || (holdableButtonAction.state && Time.realtimeSinceStartup - holdableButtonAction.changedTime > 0.4f));
 }
Beispiel #7
0
 internal override void UpdateValues(CustomController vrController)
 {
     vrController.SetButtonValueById(buttonID, buttonAction.state);
 }
Beispiel #8
0
 void OnInputUpdate()
 {
     controller.SetButtonValueById(rewiredButtonId, isShooting);
 }