guodong 2 سال پیش
والد
کامیت
60c05a4421
1فایلهای تغییر یافته به همراه6 افزوده شده و 2 حذف شده
  1. 6 2
      GameClient/Assets/Game/HotUpdate/DressUp/DressUpUtil.cs

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

@@ -230,12 +230,12 @@ namespace GFGGame
             TryRemoveObj(parentObj, aniObjName);
             string ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType);
             //这里需要先添加静态图,防止加载动画有延迟,出现光头
-            GameObject gameObject = AddSpriteObj(res, ext, spritObjName, parentObj, sortingOrder, needSetMask);
+            GameObject spriteObj = AddSpriteObj(res, ext, spritObjName, parentObj, sortingOrder, needSetMask);
 
             if (showAni)
             {
                 var aniObj = AddAnimationObj(res, aniObjName, parentObj, sortingOrder);
-                if(aniObj != null)
+                if(aniObj != null && spriteObj != null)
                 {
                     Timers.inst.Add(0.03f, 1, (obj) =>
                     {
@@ -270,6 +270,10 @@ namespace GFGGame
         private static GameObject AddSpriteObj(string res, string ext, string objName, GameObject parentObj, int sortingOrder, bool needSetMask)
         {
             string resPath = ResPathUtil.GetDressUpPath(res, ext);
+            if(!VEngine.Versions.Contains(resPath))
+            {
+                return null;
+            }
             SpriteRenderer spr = null;
             var gameObj = parentObj.transform.Find(objName)?.gameObject;
             if (gameObj == null)