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); } }
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); }
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); }
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); }
public void StopVibration(XInput.Trigger trigger) { SetVibration(trigger, 0f); }
public bool CanVibrate(XInput.Trigger trigger) { return(motors[trigger].CanVibrate); }