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/ResModule/AssetBundle/AssetBundleUtility.cs |   31 +++++++++++++++++++++----------
 1 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/Main/ResModule/AssetBundle/AssetBundleUtility.cs b/Main/ResModule/AssetBundle/AssetBundleUtility.cs
index 9b754d1..f5ae8c6 100644
--- a/Main/ResModule/AssetBundle/AssetBundleUtility.cs
+++ b/Main/ResModule/AssetBundle/AssetBundleUtility.cs
@@ -5,6 +5,11 @@
 using UnityEngine;
 using Cysharp.Threading.Tasks;
 
+/// <summary>
+/// [Obsolete] US1: 宸茶 YooAssetService 鏇夸唬銆傚皢鍦� Phase 10 (T060) 鐗╃悊鍒犻櫎銆�
+/// 褰撳墠浠嶄繚鐣欎互鏀寔 AssetBundleInitTask 鐨勫惎鍔ㄥ吋瀹规�с��
+/// </summary>
+[System.Obsolete("Use ProjSG.Resource.YooAssetService instead. This class will be removed in Phase 10 (T060).")]
 public class AssetBundleUtility : SingletonMonobehaviour<AssetBundleUtility>
 {
     private List<AssetBundleInfo> m_AssetBundleInfoList = new List<AssetBundleInfo>();
@@ -19,7 +24,7 @@
 
     public void InitBuiltInAsset()
     {
-        var path = AssetVersionUtility.GetBuiltInAssetFilePath(StringUtility.Contact(AssetVersionUtility.EncodeFileName("builtin"), "_assetbundle"), false);
+        var path = AssetVersionUtility.GetBuiltInAssetFilePath(StringUtility.Concat(AssetVersionUtility.EncodeFileName("builtin"), "_assetbundle"), false);
         var assetBundle = AssetBundle.LoadFromFile(path);
         if (assetBundle == null)
         {
@@ -51,7 +56,7 @@
         // CloseAllIgnoreWindowConfig.Release();
         UnloadAssetBundle("builtin/scriptableobjects", true, false);
 
-        var path = AssetVersionUtility.GetBuiltInAssetFilePath(StringUtility.Contact(AssetVersionUtility.EncodeFileName("builtin"), "_assetbundle"), false);
+        var path = AssetVersionUtility.GetBuiltInAssetFilePath(StringUtility.Concat(AssetVersionUtility.EncodeFileName("builtin"), "_assetbundle"), false);
         var assetBundle = AssetBundle.LoadFromFile(path);
         if (assetBundle == null)
         {
@@ -99,10 +104,11 @@
 
     public async UniTask Initialize()
     {
+        await UniTask.Delay(200);
         await Co_LoadMainfestFile("audio");
         // await Co_LoadMainfestFile("video");
         await Co_LoadMainfestFile("mobeffectshader");
-        // await Co_LoadMainfestFile("config");
+        await Co_LoadMainfestFile("config");
         await Co_LoadMainfestFile("maps");
         await Co_LoadMainfestFile("ui");
 
@@ -113,22 +119,22 @@
         initialized = true;
     }
 
-    private async UniTask Co_LoadMainfestFile(string _category)
+    private UniTask Co_LoadMainfestFile(string _category)
     {
-        var path = AssetVersionUtility.GetAssetFilePath(StringUtility.Contact(AssetVersionUtility.EncodeFileName(_category), "_assetbundle"), false);
+        var path = AssetVersionUtility.GetAssetFilePath(StringUtility.Concat(AssetVersionUtility.EncodeFileName(_category), "_assetbundle"), false);
         var _assetBundle = AssetBundle.LoadFromFile(path);
 
         if (_assetBundle == null)
         {
             Debug.LogErrorFormat("AssetBundleManifest鐨勫寘鏂囦欢涓虹┖鎴栬�呭姞杞藉嚭閿�.  Path:{0}", path);
-            return;
+            return UniTask.CompletedTask;
         }
 
         AssetBundleManifest _assetBundleManifest = _assetBundle.LoadAsset<AssetBundleManifest>(ResourcesPath.AssetDependentFileAssetName);
         if (_assetBundleManifest == null)
         {
             Debug.LogErrorFormat("AssetBundleManifest鐨勫寘鏂囦欢涓虹┖鎴栬�呭姞杞藉嚭閿�.  Path:{0}", path);
-            return;
+            return UniTask.CompletedTask;
         }
 
         string[] _assetBundleNames = _assetBundleManifest.GetAllAssetBundles();
@@ -142,6 +148,7 @@
 
         _assetBundle.Unload(true);
         _assetBundle = null;
+        return UniTask.CompletedTask;
     }
 
     public AssetBundleInfo GetAssetBundleInfo(string assetBundleName)
@@ -369,7 +376,11 @@
 
     public UnityEngine.Object Sync_LoadAsset(string assetBundleName, string assetName, Type _type = null)
     {
-
+        if (string.IsNullOrEmpty(assetName))
+        {
+            Debug.LogErrorFormat("Sync_LoadAsset(): {0}, 鍑虹幇閿欒 => 瀛樺叆鐨凙ssetName涓簄ull. ", assetName);
+            return null;
+        }
 #if UNITY_5||UNITY_5_3_OR_NEWER
         assetBundleName = assetBundleName.ToLower();
 #endif
@@ -496,7 +507,7 @@
 #if UNITY_5||UNITY_5_3_OR_NEWER
         assetBundleName = assetBundleName.ToLower();
 #endif
-        string _assembleName = StringUtility.Contact(assetBundleName, "@", assetName);
+        string _assembleName = StringUtility.Concat(assetBundleName, "@", assetName);
 
         if (JudgeExistAsset(assetBundleName, assetName) == false)
         {
@@ -672,7 +683,7 @@
 
         m_AssetDict[assetBundleName][assetName] = asset;
 
-        string _assembleName = StringUtility.Contact(assetBundleName, "@", assetName);
+        string _assembleName = StringUtility.Concat(assetBundleName, "@", assetName);
         if (m_AssetInfoDict.ContainsKey(_assembleName) == false)
         {
             AssetInfo _assetInfo = new AssetInfo(assetBundleName, assetName);

--
Gitblit v1.8.0