yyl
2026-05-11 51b0f6ed9f4e1d3bb6f8144470b46908c7699a96
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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;
    }
}