public override void OnStateEnter(MyMovementState previousState) { _currentChargeVelocity = KinematicCharacterMotor.CharacterTransform.forward * ChargeSpeed; _isStopped = false; _timeSinceStartedCharge = 0f; _timeSinceStopped = 0f; }
/// <summary> /// Handles movement state transitions and enter/exit callbacks /// </summary> public void TransitionToState(MyMovementState newState) { newState.AssignedCharacterController = this; newState.KinematicCharacterMotor = this.KinematicCharacterMotor; if (CurrentMovementState != null) { CurrentMovementState.OnStateExit(newState); } MyMovementState prevState = CurrentMovementState; CurrentMovementState = newState; CurrentMovementState.OnStateEnter(prevState); }
public override void OnStateEnter(MyMovementState previousState) { }
public override void OnStateExit(MyMovementState nextState) { }
public abstract void OnStateEnter(MyMovementState previousState);
public abstract void OnStateExit(MyMovementState nextState);