From 9b09f189e2830126a6d2f45dcba6b64c316960d0 Mon Sep 17 00:00:00 2001 From: hch <305670599@qq.com> Date: 星期二, 16 九月 2025 20:56:33 +0800 Subject: [PATCH] 0312 增加下载模块 --- Main/System/AssetVersion/InGameDownLoad.cs | 21 ++++++++++----------- 1 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Main/System/AssetVersion/InGameDownLoad.cs b/Main/System/AssetVersion/InGameDownLoad.cs index dfcc104..3a5965e 100644 --- a/Main/System/AssetVersion/InGameDownLoad.cs +++ b/Main/System/AssetVersion/InGameDownLoad.cs @@ -27,7 +27,7 @@ public bool isDone { get { return state == State.Completed; } } //鏄惁鍏ㄩ儴涓嬭浇瀹屾垚 //绐楀彛涓樉绀虹殑宸蹭笅杞藉ぇ灏� - public long showDownLoadedSize { get { return DownloadMgr.Instance.DownloadedBytes - backGroundDownLoadSizeRecord; } } + public long showDownLoadedSize { get { return DownloadHotMgr.Instance.DownloadedBytes - backGroundDownLoadSizeRecord; } } public long showTotalSize { get { return totalSize - backGroundDownLoadSizeRecord; } }//绐楀彛涓樉绀虹殑鎬诲ぇ灏� public int showTotalCount { get { return totalCount - downLoadedCountRecord; } }//绐楀彛涓樉绀虹殑鎬绘暟閲� public int showOkCount { get { return okCount - downLoadedCountRecord; } }//绐楀彛涓樉绀虹殑涓嬭浇瀹屾垚鏁伴噺 @@ -91,7 +91,7 @@ private void Awake() { - DownloadMgr.MaxDownLoadTask = GetMaxTask(); + DownloadHotMgr.MaxDownLoadTask = GetMaxTask(); } private void LateUpdate() @@ -145,7 +145,7 @@ okCount = 0; totalSize = 0; - DownloadMgr.Instance.Prepare(); + DownloadHotMgr.Instance.Prepare(); for (int i = 0; i < this.assets.Count; i++) { @@ -164,7 +164,7 @@ //娣诲姞涓嬭浇浠诲姟 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, assetVersion)); + DownloadHotMgr.Instance.AddTask(new DownloadHotTask(remoteURL, localURL, assetVersion)); } state = State.None; @@ -245,7 +245,7 @@ case Dominant.Half: if (dominantState == Dominant.None) { - backGroundDownLoadSizeRecord = DownloadMgr.Instance.DownloadedBytes; + backGroundDownLoadSizeRecord = DownloadHotMgr.Instance.DownloadedBytes; downLoadedCountRecord = okCount; } StartDownLoad(); @@ -254,7 +254,7 @@ case Dominant.Whole: if (dominantState == Dominant.None) { - backGroundDownLoadSizeRecord = DownloadMgr.Instance.DownloadedBytes; + backGroundDownLoadSizeRecord = DownloadHotMgr.Instance.DownloadedBytes; downLoadedCountRecord = okCount; Pause(); state = State.Prepared; @@ -265,8 +265,7 @@ state = State.Prepared; } dominantState = Dominant.Whole; - UIManager.Instance.OpenWindow<InGameDownLoadWin>(); - // // WindowCenter.Instance.Open<InGameDownLoadWin>(); + // UIManager.Instance.OpenWindow<InGameDownLoadWin>(); break; } } @@ -277,7 +276,7 @@ if (state == State.None || state == State.Prepared || state == State.Pause) { state = State.DownLoad; - DownloadMgr.Instance.Begin(OnFileDownLoadCompleted); + DownloadHotMgr.Instance.Begin(OnFileDownLoadCompleted); } } @@ -286,13 +285,13 @@ { if (state == State.DownLoad) { - DownloadMgr.Instance.Stop(); + DownloadHotMgr.Instance.Stop(); state = State.Pause; } } //鏂囦欢涓嬭浇瀹屾垚鍥炶皟 - private bool OnFileDownLoadCompleted(bool finished, DownloadTask task) + private bool OnFileDownLoadCompleted(bool finished, DownloadHotTask task) { if (task.IsDone && task.obj is AssetVersion) { -- Gitblit v1.8.0