Browse Source

代码整理

guodong 1 năm trước cách đây
mục cha
commit
2543d2a611

+ 1 - 1
GameClient/Assets/AssetBundleCollectorSetting.asset

@@ -171,7 +171,7 @@ MonoBehaviour:
         UserData: 
     - GroupName: scene
       GroupDesc: 
-      AssetTags: 
+      AssetTags: preload
       ActiveRuleName: EnableGroup
       Collectors:
       - CollectPath: Assets/ResIn/Scene

+ 4 - 0
GameClient/Assets/Game/HotUpdate/Assets/PrefabManager.cs

@@ -17,6 +17,10 @@ namespace GFGGame
 
         public GameObject SpawnSync(string resPath)
         {
+            if (!YooAssets.CheckResExist(resPath))
+            {
+                return null;
+            }
             if (!_entitySpawner.IsGameObjectPoolExisted(resPath))
             {
                 // 创建游戏对象池,销毁时间单位为秒

+ 2 - 16
GameClient/Assets/Game/HotUpdate/DressUp/DressUpUtil.cs

@@ -1,7 +1,6 @@
 using UnityEngine;
 using Live2D.Cubism.Rendering;
 using System.IO;
-using FairyGUI;
 using UnityEngine.Rendering;
 using YooAsset;
 using System.Collections.Generic;
@@ -523,7 +522,7 @@ namespace GFGGame
             {
                 return gameObj;
             }
-            gameObj = CreateObj(resPath);
+            gameObj = PrefabManager.Instance.SpawnSync(resPath);
             if(gameObj == null)
             {
                 return null;
@@ -560,7 +559,7 @@ namespace GFGGame
             {
                 return gameObj;
             }
-            gameObj = CreateObj(resPath);
+            gameObj = PrefabManager.Instance.SpawnSync(resPath);
             if (gameObj == null)
             {
                 return null;
@@ -620,19 +619,6 @@ namespace GFGGame
             return null;
         }
 
-        public static GameObject CreateObj(string resPath)
-        {
-            if (!YooAssets.CheckResExist(resPath))
-            {
-                return null;
-            }
-            //var handle = YooAssets.LoadAssetSync<Sprite>(resPath);
-            //Sprite sp = handle.AssetObject as Sprite;
-            var gameObj = PrefabManager.Instance.SpawnSync(resPath);
-            //AddAssetReleaser(gameObj, resPath);
-            return gameObj;
-        }
-
         public static void LoadSpritePos(string resPath, out float tx, out float ty)
         {
             int index = resPath.LastIndexOf('.');

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Effect/EffectUI.cs

@@ -24,7 +24,7 @@ namespace GFGGame
                     resPath = ResPathUtil.GetViewEffectPath(uiName, resName);
                     break;
             }
-            _gameObject = DressUpUtil.CreateObj(resPath);
+            _gameObject = PrefabManager.Instance.SpawnSync(resPath);
             if(_gameObject == null)
             {
                 return;