using Cysharp.Threading.Tasks;
|
using UnityEngine;
|
|
/// <summary>
|
/// WebGL 平台专用系统初始化任务。
|
/// 因为 BuiltInAssetCopyTask 被 #if !UNITY_WEBGL 排除,
|
/// 所以 WebGL 需要一个独立任务在 YooAsset 初始化完成后
|
/// 调用 InitSystemMgr() 初始化 UIManager、StageManager 等,并显示 LaunchWin。
|
/// </summary>
|
public class WebGLSystemInitTask : LaunchTask
|
{
|
public override float expectTime
|
{
|
get { return LocalSave.GetFloat("WebGLSystemInitTask_ExpectTime", 0.5f); }
|
protected set { LocalSave.SetFloat("WebGLSystemInitTask_ExpectTime", value); }
|
}
|
|
public override void Begin()
|
{
|
duration = 0.5f;
|
done = true;
|
}
|
|
public override async void End()
|
{
|
expectTime = timer;
|
Debug.LogFormat("{0}执行时长:{1};", GetType().Name, timer);
|
|
await LaunchInHot.Instance.InitSystemMgr();
|
|
UIManager.Instance.OpenWindowAsync<LaunchWin>().Forget();
|
|
UIManager.Instance.CloseWindow<DownLoadWin>();
|
UIManager.Instance.CloseWindow<VersionUpdateWin>();
|
}
|
|
public override void Update()
|
{
|
if (done) return;
|
}
|
}
|