public void ApplyControlledMovement(ref PlayerState state, Vector2 movementInput) { var data = StateMachine.GetControllerState(ref state).Data; ApplyDirection(ref state, movementInput, data); ApplyMovement(ref state, movementInput, data); }
public void ApplyState(ref PlayerState state) { StateMachine.Presimulate(ref state); var timeline = StateMachine.GetControllerState(ref state).Data.Timeline; if (timeline != Director.playableAsset) { Director.Play(timeline); stateDuration = Director.duration; if (stateDuration == 0) { stateDuration = 1; } } Director.time = state.StateTime % stateDuration; Director.Evaluate(); }
public bool IsShieldActive(ref PlayerState state) => StateMachine.GetControllerState(ref state) is ShieldState;