public override float GetAxisRaw(string axisName) { float axisVal = 0; InputAxis axis = FindAxis(axisName); if (axis != null) { if (CanExecute() || axis.allowedStateOverride != 0) { axisVal = axis.GetAxisRaw(PlayerId); } } return(axisVal); }
public override float GetAxis(string axisName) { float axisVal = 0; InputAxis axis = FindAxis(axisName); if (axis != null && IsEnabled && HaveControl) { //IF AXIS HAS A EXECUTION GAMESTATE OVERRIDE I WILL CHECK FOR THAT STATE if ((axis.allowedStateOverride != 0)) { axisVal = axis.GetAxis(PlayerId); } //ELSE I CHECK IF CAN BE EXECUTED BY THIS CLASS (MEANS THAT IT WILL CHECK GAMESTATES ALLOWED FROM THIS CLASS) else if (CanExecute()) { axisVal = axis.GetAxis(PlayerId); } } return(axisVal); }
protected virtual void GainControl(InputAxis inputAxis) { inputAxis.GainControl(); }
protected virtual void ReleaseControl(InputAxis inputAxis) { inputAxis.ReleaseControl(); }