2024-05-17 19:27:02 +08:00
|
|
|
using Cysharp.Threading.Tasks;
|
2023-08-22 19:08:45 +08:00
|
|
|
using Framework;
|
|
|
|
|
using Gameplay;
|
|
|
|
|
using Gameplay.Level;
|
|
|
|
|
using Gameplay.SubSystems;
|
|
|
|
|
|
2023-10-19 15:00:19 +08:00
|
|
|
public class GameStateLevel : IState
|
2023-08-22 19:08:45 +08:00
|
|
|
{
|
2023-10-19 15:00:19 +08:00
|
|
|
private int _levelId;
|
|
|
|
|
public GameStateLevel(int levelId)
|
2023-08-22 19:08:45 +08:00
|
|
|
{
|
|
|
|
|
_levelId = levelId;
|
|
|
|
|
}
|
|
|
|
|
public void OnEnter()
|
|
|
|
|
{
|
2024-05-17 19:27:02 +08:00
|
|
|
LoadingExecutorManager.Instance.ExecuteLoading(new LevelLoadingExecutor(_levelId)).Forget();
|
2024-06-04 15:13:16 +08:00
|
|
|
|
|
|
|
|
EventManager.Instance.Send(EventManager.EventName.Guide_ChangeLevelState);
|
2023-08-22 19:08:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void OnUpdate(float deltaTime)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void OnExit()
|
|
|
|
|
{
|
|
|
|
|
LevelManager.Instance.UnloadLevel();
|
|
|
|
|
}
|
|
|
|
|
}
|