Forest_Client/Forest/Assets/Scripts/Gameplay/Manager/GameStateManager.cs

33 lines
649 B
C#
Raw Normal View History

2024-06-12 15:01:54 +08:00
using Framework.State;
using PhxhSDK;
namespace Gameplay.Manager
{
public class GameStateManager : Singlenton<GameStateManager> , IUpdatable, IInitable
{
private StateMachine _stateMachine;
public void Update(float deltaTime)
{
_stateMachine.Update(deltaTime);
}
public void Init()
{
_stateMachine = new StateMachine();
}
public void Release()
{
_stateMachine = null;
}
public void ChangeState(IState state)
{
_stateMachine.ChangeState(state);
}
}
}