public PlayerAttack() { NormalState = new PlayerNormalState(this); EnhanceState = new PlayerEnhanceState(this); ParalysisState = new PlayerParalysisState(this); _currentState = NormalState; }
public void ChangeState(AbstractPlayerState newState) { Debug.Log($"Transitioning from {_currentState?.GetType()} to {newState?.GetType()}"); var oldState = _currentState; _currentState = newState; oldState?.OnStateExit(); newState.OnStateEnter(); }
public void SetState(AbstractPlayerState state) { _currentState = state; }