Browse Source

Merge branch 'master' of http://git.gfggame.com:3000/gfg/client

zhaoyang 3 years ago
parent
commit
99b8f48839
1 changed files with 12 additions and 6 deletions
  1. 12 6
      GameClient/Assets/Game/HotUpdate/DressUp/DressUpUtil.cs

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

@@ -1,7 +1,7 @@
 using UnityEngine;
-using System;
 using Live2D.Cubism.Rendering;
 using System.IO;
+using FairyGUI;
 
 namespace GFGGame
 {
@@ -201,14 +201,20 @@ namespace GFGGame
                 GameObject.DestroyImmediate(tf.gameObject);
                 tf = null;
             }
+            string ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType);
+            AddSpriteObj(res, ext, objName, parentObj, sortingOrder, needSetMask);
             if (itemCfg.isAni > 0 && showAni)
             {
+                tf = parentObj.transform.Find(objName);
                 AddAnimationObj(res, objName, parentObj, sortingOrder);
-            }
-            else
-            {
-                string ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType);
-                AddSpriteObj(res, ext, objName, parentObj, sortingOrder, needSetMask);
+                Timers.inst.Add(0.03f, 1, (obj) =>
+                {
+                    if (tf != null && tf.gameObject != null && tf.gameObject.activeInHierarchy)
+                    {
+                        GameObject.DestroyImmediate(tf.gameObject);
+                        tf = null;
+                    }
+                });
             }
 
         }