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

36 lines
790 B
C#

using System.Collections.Generic;
using Framework;
using Gameplay.Performance;
using PhxhSDK;
using UnityEngine;
using UnityEngine.Device;
using UnityEngine.EventSystems;
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);
PerformanceManager.ClearRaycasterImage();
_stateMachine.ChangeState(state);
}
}