feat: GameManager相关重构
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using System.Collections;
|
||||
using AibisDream.Framework;
|
||||
using AibisDream.SaveSystem;
|
||||
using AibisDream.UI;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AibisDream
|
||||
{
|
||||
/// <summary>负责 Persistence 场景中的应用级初始化,不参与游戏会话流程。</summary>
|
||||
[DefaultExecutionOrder(-100)]
|
||||
public sealed class ApplicationBootstrapper : MonoBehaviour
|
||||
{
|
||||
private const float MainMenuFadeDuration = 0.5f;
|
||||
|
||||
private IEnumerator Start()
|
||||
{
|
||||
SettingLoader.Init();
|
||||
SnapshotRegistry.EnsureInitialized();
|
||||
|
||||
var transitionPanel = UIManager.Instance.GetPanel<ScreenTransitionPanel>();
|
||||
UIManager.Instance.ShowPanel<ScreenTransitionPanel>();
|
||||
transitionPanel?.ApplyScreenCovered(true);
|
||||
|
||||
yield return LocalizationKit.WaitUntilReady();
|
||||
|
||||
EnumEventSystem.Global.Send(GameLifecycleEvent.ApplicationReady);
|
||||
|
||||
yield return LocalizationKit.WaitForUIRefresh();
|
||||
if (transitionPanel != null)
|
||||
{
|
||||
yield return transitionPanel.FadeOutAsync(MainMenuFadeDuration);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user