NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/Game/GameStateManager.cs

29 lines
535 B
C#
Raw Normal View History

2023-08-22 19:08:45 +08:00
using Framework;
2023-10-19 15:00:19 +08:00
using PhxhSDK;
2023-08-22 19:08:45 +08:00
2023-10-19 15:00:19 +08:00
public class GameStateManager : Singlenton<GameStateManager> , IUpdatable, IInitable
2023-08-22 19:08:45 +08:00
{
2023-10-19 15:00:19 +08:00
private StateMachine _stateMachine;
2023-08-22 19:08:45 +08:00
public void Update(float deltaTime)
{
_stateMachine.Update(deltaTime);
}
public void Init()
{
2023-10-19 15:00:19 +08:00
_stateMachine = new StateMachine();
2023-08-22 19:08:45 +08:00
}
public void Release()
{
_stateMachine = null;
}
2023-10-19 15:00:19 +08:00
public void ChangeState(IState state)
2023-08-22 19:08:45 +08:00
{
_stateMachine.ChangeState(state);
}
}