42 lines
975 B
C#
42 lines
975 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);
|
|
// TODO: 目前看起来没什么用,先注释掉 2024-3-4 14:34 by liutao
|
|
// PerformanceManager.ClearRaycasterImage();
|
|
_stateMachine.ChangeState(state);
|
|
}
|
|
|
|
public IState GetCurState()
|
|
{
|
|
return _stateMachine.GetCurrentState();
|
|
}
|
|
}
|