ProjectDDD/Assets/_Datas/02.Scripts/Characters/Players/RestaurantPlayer/PlayerStateMachine.cs

19 lines
380 B (Stored with Git LFS)
C#

namespace DDD
{
public class PlayerStateMachine
{
private IPlayerState _currentState;
public void ChangeState(IPlayerState newState)
{
_currentState?.Exit();
_currentState = newState;
_currentState.Enter();
}
public void Update()
{
_currentState?.Update();
}
}
}