Pārlūkot izejas kodu

Merge branch 'master' of http://10.108.64.190:3000/gfg/client

zhaoyang 2 gadi atpakaļ
vecāks
revīzija
593211db88
1 mainītis faili ar 25 papildinājumiem un 27 dzēšanām
  1. 25 27
      GameClient/Assets/Game/HotUpdate/DressUp/DressUpUtil.cs

+ 25 - 27
GameClient/Assets/Game/HotUpdate/DressUp/DressUpUtil.cs

@@ -1,6 +1,7 @@
 using UnityEngine;
 using Live2D.Cubism.Rendering;
 using System.IO;
+using FairyGUI;
 
 namespace GFGGame
 {
@@ -248,37 +249,34 @@ namespace GFGGame
             var aniObjName = string.Format(FORMAT_ANIMATION_NAME, itemCfg.subType, layerId);
             TryRemoveAnimationObj(parentObj, aniObjName);
             string ext = ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType);
-
+            //这里需要先添加静态图,防止加载动画有延迟,出现光头
+            GameObject gameObject = AddSpriteObj(res, ext, spritObjName, parentObj, sortingOrder, needSetMask);
 
             if (itemCfg.isAni > 0 && showAni)
             {
                 AddAnimationObj(res, aniObjName, parentObj, sortingOrder);
-                //Timers.inst.Add(0.03f, 1, (obj) =>
-                //{
-                //    if (parentObj != null && parentObj.transform != null)
-                //    {
-                //        Transform tf = parentObj.transform.Find(spritObjName);
-                //        if (tf != null && tf.gameObject != null && tf.gameObject.activeInHierarchy)
-                //        {
-                //            var assetDisposer = tf.gameObject.GetComponent<AssetReleaser>();
-                //            if (assetDisposer != null)
-                //            {
-                //                if (!string.IsNullOrEmpty(assetDisposer.resPath))
-                //                {
-                //                    string resPath = ResPathUtil.GetDressUpPath(res, ext);
-                //                    if (assetDisposer.resPath == resPath)
-                //                    {
-                //                        TryClearSpriteObj(parentObj, spritObjName);
-                //                    }
-                //                }
-                //            }
-                //        }
-                //    }
-                //});
-            }
-            else
-            {
-                GameObject gameObject = AddSpriteObj(res, ext, spritObjName, parentObj, sortingOrder, needSetMask);
+                Timers.inst.Add(0.03f, 1, (obj) =>
+                {
+                    if (parentObj != null && parentObj.transform != null)
+                    {
+                        Transform tf = parentObj.transform.Find(spritObjName);
+                        if (tf != null && tf.gameObject != null && tf.gameObject.activeInHierarchy)
+                        {
+                            var assetDisposer = tf.gameObject.GetComponent<AssetReleaser>();
+                            if (assetDisposer != null)
+                            {
+                                if (!string.IsNullOrEmpty(assetDisposer.resPath))
+                                {
+                                    string resPath = ResPathUtil.GetDressUpPath(res, ext);
+                                    if (assetDisposer.resPath == resPath)
+                                    {
+                                        TryClearSpriteObj(parentObj, spritObjName);
+                                    }
+                                }
+                            }
+                        }
+                    }
+                });
             }
         }