Exemplo n.º 1
0
        public IEnumerator SetVibrationCorout(XInput.Trigger trigger, float value, float duration)
        {
            SetVibration(trigger, value);

            yield return(new WaitForSeconds(duration));

            motors[trigger].FreeCorout();

            if (motors[trigger].HasNoCorout)
            {
                StopVibration(trigger);
            }
        }
Exemplo n.º 2
0
        public bool TriggerReleased(XInput.Trigger trigger)
        {
            if (trigger == XInput.Trigger.Left)
            {
                return(state.Triggers.Left < triggerMinValueToConsiderPressedOrReleased && prevState.Triggers.Left >= triggerMinValueToConsiderPressedOrReleased);
            }
            else if (trigger == XInput.Trigger.Right)
            {
                return(state.Triggers.Right < triggerMinValueToConsiderPressedOrReleased && prevState.Triggers.Right >= triggerMinValueToConsiderPressedOrReleased);
            }

            return(false);
        }
Exemplo n.º 3
0
        public float GetTriggerValue(XInput.Trigger trigger)
        {
            if (trigger == XInput.Trigger.Left)
            {
                return(state.Triggers.Left);
            }
            else if (trigger == XInput.Trigger.Right)
            {
                return(state.Triggers.Right);
            }

            return(0f);
        }
Exemplo n.º 4
0
 public void SetVibration(XInput.Trigger trigger, float value)
 {
     motors[trigger].SetVibration(value);
     GamePad.SetVibration(playerIndex, motors[XInput.Trigger.Left].Value, motors[XInput.Trigger.Right].Value);
 }
Exemplo n.º 5
0
 public void StopVibration(XInput.Trigger trigger)
 {
     SetVibration(trigger, 0f);
 }
Exemplo n.º 6
0
 public bool CanVibrate(XInput.Trigger trigger)
 {
     return(motors[trigger].CanVibrate);
 }