From 51b0f6ed9f4e1d3bb6f8144470b46908c7699a96 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期一, 11 五月 2026 16:20:37 +0800
Subject: [PATCH] Merge branch 'master' into h5version
---
Main/System/AssetVersion/InGameDownLoad.cs | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/Main/System/AssetVersion/InGameDownLoad.cs b/Main/System/AssetVersion/InGameDownLoad.cs
index ed1a2a0..8601a66 100644
--- a/Main/System/AssetVersion/InGameDownLoad.cs
+++ b/Main/System/AssetVersion/InGameDownLoad.cs
@@ -143,6 +143,15 @@
//寮�濮嬪垎閰嶄换鍔�
public void AssignTasks(List<AssetVersion> assets, Action _onDownLoadOk)
{
+#if UNITY_WEBGL
+ // WebGL 涓嬫枃浠朵笅杞界敱 YooAsset WebPlayMode 澶勭悊锛岃烦杩囨棫鐨勬枃浠朵笅杞芥祦绋�
+ Debug.Log("[InGameDownLoad] WebGL 骞冲彴璺宠繃鏂囦欢涓嬭浇锛孻ooAsset 璐熻矗璧勬簮鍔犺浇");
+ foreach (var asset in assets)
+ asset.localValid = true;
+ state = State.Completed;
+ _onDownLoadOk?.Invoke();
+ return;
+#endif
this.inGameDownLoadAllow = false;
this.assets = assets;
@@ -155,13 +164,21 @@
DownloadHotMgr.Instance.Prepare();
+ var versionConfig = VersionConfig.config;
+
+ if (null == versionConfig)
+ {
+ // 濡傛灉鍓嶉潰閮芥病鑾峰彇鍒伴偅涓�瀹氭槸鍝噷鍑洪棶棰樹簡 浠庤繖閲屾墦鏂�
+ throw new Exception("VersionConfig is null when AssignTasks, game will pause here");
+ }
+
for (int i = 0; i < this.assets.Count; i++)
{
var assetVersion = this.assets[i];
totalSize += assetVersion.size;//缁熻璧勬簮鎬诲ぇ灏�
//娣诲姞涓嬭浇浠诲姟
- var remoteURL = StringUtility.Concat(VersionUtility.Instance.versionInfo.GetResourcesURL(VersionConfig.Get().branch), Language.fixPath, "/", assetVersion.relativePath);
+ var remoteURL = StringUtility.Concat(VersionUtility.Instance.versionInfo.GetResourcesURL(versionConfig.branch), Language.fixPath, "/", assetVersion.relativePath);
var localURL = StringUtility.Concat(ResourcesPath.Instance.ExternalStorePath, assetVersion.relativePath);
DownloadHotMgr.Instance.AddTask(new DownloadHotTask(remoteURL, localURL, assetVersion));
}
@@ -263,7 +280,7 @@
state = State.Prepared;
}
dominantState = Dominant.Whole;
- UIManager.Instance.OpenWindow<InGameDownLoadWin>();
+ UIManager.Instance.OpenWindowAsync<InGameDownLoadWin>().Forget();
break;
}
}
--
Gitblit v1.8.0