Пример #1
0
 public void ValueModifierEntered(ValueModifierUI val)
 {
     prevState       = state;
     state           = Enums.UIStates.ValueModifier;
     currentValueMod = val;
     currentValueMod.GetComponent <Selectable>().interactable = false;
 }
Пример #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)
            {
                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;
            }
        }
Пример #3
0
 public void ValueModifierEntered(ValueModifierUI val)
 {
     prevState       = state;
     prevSelected    = EventSystem.current.currentSelectedGameObject;
     state           = Enums.UIStates.ValueModifier;
     currentValueMod = val;
     currentValueMod.GetComponent <Selectable>().interactable = false;
 }
Пример #4
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);
            }
        }
Пример #5
0
		public void ValueModifierEntered(ValueModifierUI val) {
			prevState = state;
			state = Enums.UIStates.ValueModifier;
			currentValueMod = val;
			currentValueMod.GetComponent<Selectable>().interactable = false;
		}
Пример #6
0
		public void ValueModifierEntered(ValueModifierUI val) {
			prevState = state;
			prevSelected = EventSystem.current.currentSelectedGameObject;
			state = Enums.UIStates.ValueModifier;
			currentValueMod = val;
			currentValueMod.GetComponent<Selectable>().interactable = false;
		}