AlicizaX/Client/Assets/Scripts/Startup/Framework/Procedure/ProcedureLauncherState.cs

43 lines
955 B
C#
Raw Normal View History

2025-01-23 19:06:48 +08:00
using Cysharp.Threading.Tasks;
2025-04-28 19:45:45 +08:00
using AlicizaX;
2025-01-23 19:06:48 +08:00
namespace Unity.Startup.Procedure
{
/// <summary>
/// 启动游戏
/// </summary>
2025-04-28 19:45:45 +08:00
public class ProcedureLauncherState : StateBase<UpdateProcedureState>
2025-01-23 19:06:48 +08:00
{
private bool _gameSettingInitFinish;
2025-04-28 19:45:45 +08:00
protected override async void OnEnter()
2025-01-23 19:06:48 +08:00
{
2025-04-28 19:45:45 +08:00
await UniTask.Delay(1000);
LauncherUIHandler.Start().Forget();
2025-01-23 19:06:48 +08:00
InitlizeGameSetting();
}
2025-04-28 19:45:45 +08:00
private async void Start()
2025-01-23 19:06:48 +08:00
{
await UniTask.NextFrame();
2025-04-28 19:45:45 +08:00
SwitchState(UpdateProcedureState.ProcedureGetGlobalInfoState);
2025-01-23 19:06:48 +08:00
}
2025-04-28 19:45:45 +08:00
protected override void OnUpdate(float deltaTime)
2025-01-23 19:06:48 +08:00
{
2025-04-28 19:45:45 +08:00
base.OnUpdate(deltaTime);
2025-01-23 19:06:48 +08:00
if (_gameSettingInitFinish)
{
2025-04-28 19:45:45 +08:00
Start();
2025-01-23 19:06:48 +08:00
}
}
private void InitlizeGameSetting()
{
_gameSettingInitFinish = true;
}
}
2025-04-28 19:45:45 +08:00
}