hch
2025-09-16 9b09f189e2830126a6d2f45dcba6b64c316960d0
Main/System/AssetVersion/DownLoadAndDiscompressHotTask.cs
File was renamed from Main/System/AssetVersion/DownLoadAndDiscompressTask.cs
@@ -6,13 +6,13 @@
using Cysharp.Threading.Tasks;
public class DownLoadAndDiscompressTask : Singleton<DownLoadAndDiscompressTask>
public class DownLoadAndDiscompressHotTask : Singleton<DownLoadAndDiscompressHotTask>
{
    public const int BYTE_PER_KILOBYTE = 1024;
    public const int BYTE_PER_MILLIONBYTE = 1048576;
    public float progress { get { return Mathf.Clamp01((float)DownloadMgr.Instance.DownloadedBytes / totalSize); } }
    public float progress { get { return Mathf.Clamp01((float)DownloadHotMgr.Instance.DownloadedBytes / totalSize); } }
    List<AssetVersion> tasks = new List<AssetVersion>();
    public bool isDone { get { return step == Step.Completed; } }
@@ -73,9 +73,7 @@
        if (totalSize > BYTE_PER_MILLIONBYTE)
        {
            //  TODO YYL
            // UIManager.Instance.OpenWindow<DownLoadWin>();
            // WindowCenter.Instance.OpenFromLocal<DownLoadWin>();
            UIManager.Instance.OpenWindow<DownLoadWin>();
        }
        else
        {
@@ -88,7 +86,7 @@
    {
        step = Step.DownLoad;
        Co_StartDownLoad();
        Co_StartDownLoad().Forget();
        // SnxxzGame.Instance.StartCoroutine(Co_StartDownLoad());
        // TODO YYL
@@ -99,18 +97,18 @@
    {
        while (tasks.Count > 0)
        {
            DownloadMgr.Instance.Prepare();
            DownloadHotMgr.Instance.Prepare();
            for (int i = 0; i < tasks.Count; i++)
            {
                var assetVersion = tasks[i];
                var remoteURL = StringUtility.Contact(VersionUtility.Instance.versionInfo.GetResourcesURL(VersionConfig.Get().branch), Language.fixPath, "/", assetVersion.relativePath);
                var localURL = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, assetVersion.relativePath);
                DownloadMgr.Instance.AddTask(new DownloadTask(remoteURL, localURL));
                DownloadHotMgr.Instance.AddTask(new DownloadHotTask(remoteURL, localURL));
            }
            DownloadMgr.Instance.Begin();
            DownloadHotMgr.Instance.Begin();
            while (!DownloadMgr.Instance.IsFinished)
            while (!DownloadHotMgr.Instance.IsFinished)
            {
                await UniTask.DelayFrame(1);
            }
@@ -136,8 +134,8 @@
        step = Step.Completed;
        UIManager.Instance.OpenWindow<DownLoadWin>();
        UIManager.Instance.OpenWindow<InGameDownLoadWin>();
        UIManager.Instance.CloseWindow<DownLoadWin>();
        UIManager.Instance.CloseWindow<InGameDownLoadWin>();
        if (downLoadOkCallBack != null)
        {