30 lines
595 B
C#
30 lines
595 B
C#
using Framework;
|
|
using PhxhSDK;
|
|
|
|
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 async void ChangeState(IState state)
|
|
{
|
|
await Gameplay.UI.Utils.ShowLoadingUI(true);
|
|
_stateMachine.ChangeState(state);
|
|
}
|
|
}
|