Exemple #1
0
        private void ValueModifier()
        {
            if (ControllerManager.instance.GetAxis(ControllerInputWrapper.Axis.LeftStickY, PlayerID.One) > ControllerManager.CUSTOM_DEADZONE ||
                ControllerManager.instance.GetAxis(ControllerInputWrapper.Axis.DPadY, PlayerID.One) > 0)
            {
                if (vTimer >= delay || vTimer == 0)
                {
                    currentValueMod.IncrementValue();
                    vTimer = 0;
                }
                vTimer += Time.deltaTime;
            }
            else if (ControllerManager.instance.GetAxis(ControllerInputWrapper.Axis.LeftStickY, PlayerID.One) < -ControllerManager.CUSTOM_DEADZONE ||
                     ControllerManager.instance.GetAxis(ControllerInputWrapper.Axis.DPadY, PlayerID.One) < 0)
            {
                if (vTimer >= delay || vTimer == 0)
                {
                    currentValueMod.DecrementValue();
                    vTimer = 0;
                }
                vTimer += Time.deltaTime;
            }
            else
            {
                vTimer = 0;
            }

            if (ControllerManager.instance.GetButtonDown(ControllerInputWrapper.Buttons.B, PlayerID.One) ||
                ControllerManager.instance.GetButtonDown(ControllerInputWrapper.Buttons.A, PlayerID.One))
            {
                state = prevState;
                currentValueMod.GetComponent <Selectable>().interactable = true;
            }
        }
Exemple #2
0
        private void ValueModifier()
        {
            if (ControllerManager.instance.GetAxis(ControllerInputWrapper.Axis.LeftStickY, PlayerID.One) > ControllerManager.CUSTOM_DEADZONE ||
                ControllerManager.instance.GetAxis(ControllerInputWrapper.Axis.DPadY, PlayerID.One) > 0 ||
                ControllerManager.instance.GetAxis(ControllerInputWrapper.Axis.LeftStickX, PlayerID.One) > ControllerManager.CUSTOM_DEADZONE ||
                ControllerManager.instance.GetAxis(ControllerInputWrapper.Axis.DPadX, PlayerID.One) > 0)
            {
                if (vTimer >= delay || vTimer == 0)
                {
                    currentValueMod.IncrementValue();
                    vTimer = 0;
                    SFXManager.instance.PlayClick();
                }
                vTimer += Time.deltaTime;
            }
            else if (ControllerManager.instance.GetAxis(ControllerInputWrapper.Axis.LeftStickY, PlayerID.One) < -ControllerManager.CUSTOM_DEADZONE ||
                     ControllerManager.instance.GetAxis(ControllerInputWrapper.Axis.DPadY, PlayerID.One) < 0 ||
                     ControllerManager.instance.GetAxis(ControllerInputWrapper.Axis.LeftStickX, PlayerID.One) < -ControllerManager.CUSTOM_DEADZONE ||
                     ControllerManager.instance.GetAxis(ControllerInputWrapper.Axis.DPadX, PlayerID.One) < 0)
            {
                if (vTimer >= delay || vTimer == 0)
                {
                    currentValueMod.DecrementValue();
                    vTimer = 0;
                    SFXManager.instance.PlayClick();
                }
                vTimer += Time.deltaTime;
            }
            else
            {
                vTimer = 0;
            }

            if (ControllerManager.instance.GetButtonDown(ControllerInputWrapper.Buttons.B, PlayerID.One) ||
                ControllerManager.instance.GetButtonDown(ControllerInputWrapper.Buttons.A, PlayerID.One))
            {
                state = prevState;
                currentValueMod.GetComponent <Selectable>().interactable = true;
                Navigator.CallCancel();
                EventSystem.current.SetSelectedGameObject(prevSelected);
            }
        }