ソースを参照

无资源处理

guodong 1 年間 前
コミット
3f280d2da8
1 ファイル変更8 行追加1 行削除
  1. 8 1
      GameClient/Assets/Game/HotUpdate/Assets/PrefabManager.cs

+ 8 - 1
GameClient/Assets/Game/HotUpdate/Assets/PrefabManager.cs

@@ -67,7 +67,14 @@ namespace GFGGame
         {
             AssetOperationHandle handle = YooAssets.LoadAssetSync<GameObject>(resPath);
             GameObject gameObject = handle.InstantiateSync();
-            AssetReleaserHelper.AddReleaserToInstantiateObj(gameObject, resPath, handle);
+            if(gameObject != null)
+            {
+                AssetReleaserHelper.AddReleaserToInstantiateObj(gameObject, resPath, handle);
+            }
+            else
+            {
+                handle.Release();
+            }
             return gameObject;
         }