Selaa lähdekoodia

换装支持连衣裙隐藏默认身体

guodong 1 vuosi sitten
vanhempi
commit
161733e479

+ 10 - 7
GameClient/Assets/Game/HotUpdate/DressUp/DressUpLayerOperation.cs

@@ -269,14 +269,17 @@ namespace GFGGame
             string effectObjName = string.Format(DressUpUtil.FORMAT_EFFECT_OBJ_NAME, itemCfg.subType, layerId);
             DressUpUtil.TryRemoveObj(parentObj, effectObjName);
             //添加新的
-            if (this.showAni)
+            if(!string.IsNullOrEmpty(this.resPath))
             {
-                DressUpUtil.AddAnimationObj(resPath, aniObjName, parentObj, sortingOrder);
-            }
-            else
-            {
-                string ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType);
-                DressUpUtil.AddSpriteObj(resPath, spritObjName, parentObj, sortingOrder, needSetMask);
+                if (this.showAni)
+                {
+                    DressUpUtil.AddAnimationObj(resPath, aniObjName, parentObj, sortingOrder);
+                }
+                else
+                {
+                    string ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType);
+                    DressUpUtil.AddSpriteObj(resPath, spritObjName, parentObj, sortingOrder, needSetMask);
+                }
             }
             if (!string.IsNullOrEmpty(effectResPath))
             {

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

@@ -200,9 +200,23 @@ namespace GFGGame
             }
             else
             {
-                resPath = ResPathUtil.GetDressUpPath(BODY_DEFAULT_RES_NAME, extPng);
+                bool hideBody = false;
+                if(itemIdLianYiQun > 0)
+                {
+                    ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemIdLianYiQun);
+                    hideBody = itemCfg.HideBody > 0;
+                }
+                if(hideBody)
+                {
+                    resPath = null;
+                }
+                else
+                {
+                    resPath = ResPathUtil.GetDressUpPath(BODY_DEFAULT_RES_NAME, extPng);
+                }
+
             }
-            if (!YooAssets.CheckResExist(resPath))
+            if (!string.IsNullOrEmpty(resPath) && !YooAssets.CheckResExist(resPath))
             {
                 return null;
             }