Sfoglia il codice sorgente

添加服装合成的延迟一帧出现

leiyasi 1 anno fa
parent
commit
c0dd4e1047

+ 6 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/ClothingSynthetic/UI_ClothingSyntheticUI.cs

@@ -19,6 +19,8 @@ namespace UI.ClothingSynthetic
         public GList m_listClothing;
         public GButton m_btnProduction;
         public GComponent m_comCostCurrency;
+        public Transition m_hide;
+        public Transition m_show;
         public const string URL = "ui://4f294tdkj5391";
         public const string PACKAGE_NAME = "ClothingSynthetic";
         public const string RES_NAME = "ClothingSyntheticUI";
@@ -78,6 +80,8 @@ namespace UI.ClothingSynthetic
             m_listClothing = (GList)comp.GetChild("listClothing");
             m_btnProduction = (GButton)comp.GetChild("btnProduction");
             m_comCostCurrency = (GComponent)comp.GetChild("comCostCurrency");
+            m_hide = comp.GetTransition("hide");
+            m_show = comp.GetTransition("show");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -95,6 +99,8 @@ namespace UI.ClothingSynthetic
             m_listClothing = null;
             m_btnProduction = null;
             m_comCostCurrency = null;
+            m_hide = null;
+            m_show = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 18 - 9
GameClient/Assets/Game/HotUpdate/Views/ClothingSynthetic/ClothingSyntheticView.cs

@@ -45,7 +45,6 @@ namespace GFGGame
         private List<ItemData> _materiarsOfSelectedItem;
 
         private UI_MateriasListItem listTypeItem_CloSynthetic;
-        private bool _clearDressUpList;
 
 
         public override void Dispose()
@@ -125,11 +124,10 @@ namespace GFGGame
         protected override void OnHide()
         {
             base.OnHide();
-            _clearDressUpList = true;
             _valueBarController.OnHide();
             _ui.m_listMaterias.selectedIndex = 0;
             Timers.inst.Remove(CheckGuide);
-
+            _dressUpObjUI.dressUpObj.TakeOffAll();
         }
         protected override void RemoveEventListener()
         {
@@ -196,12 +194,6 @@ namespace GFGGame
         private EaseType ease = EaseType.CubicOut;
         private void UpdateRole(bool tween)
         {
-            if (_clearDressUpList)
-            {
-                _dressUpObjUI.dressUpObj.TakeOffAll();
-                _clearDressUpList = false;
-            }
-
             _dressUpObjUI.ResetSceneObj(45, true, true, null, false);
             _dressUpObjUI.dressUpObj.AddOrRemove(_selectedItemId, true);
             _imgSelected.visible = _dressUpObjUI.dressUpObj.CheckDressUpItemIsOn(_selectedItemId);
@@ -211,6 +203,7 @@ namespace GFGGame
             if (!tween)
             {
                 duration = 0;
+                _ui.m_hide.Play();
             }
             var dy = _ui.m_compHolder.target.height - 642;
             if (Array.IndexOf(HEAD_Y_ARR, type) >= 0)
@@ -243,6 +236,22 @@ namespace GFGGame
                 _ui.m_compHolder.m_compMover.target.TweenMoveY(BODY_Y + dy, duration).SetEase(ease);
                 _ui.m_compHolder.m_compMover.target.TweenScale(new Vector2(BODY_SCALE, BODY_SCALE), duration).SetEase(ease);
             }
+
+            if (!tween)
+            {
+                Timers.inst.StartCoroutine(DelayShow());
+            }
+
+        }
+
+        /// <summary>
+        /// 延迟一帧 防止闪一下
+        /// </summary>
+        /// <returns></returns>
+        private IEnumerator DelayShow()
+        {
+            yield return new WaitForEndOfFrame();
+            _ui.m_show.Play();
         }
 
         private void UpdateClothingList(bool tween)

BIN
GameClient/Assets/ResIn/UI/ClothingSynthetic/ClothingSynthetic_fui.bytes