Browse Source

摘星特效回收处理

huangxiaoyue 1 year ago
parent
commit
7c0767ddc5
1 changed files with 8 additions and 2 deletions
  1. 8 2
      GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxView.cs

+ 8 - 2
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxView.cs

@@ -29,8 +29,6 @@ namespace GFGGame
         {
             EffectUIPool.Recycle(_effectUI1);
             _effectUI1 = null;
-            EffectUIPool.Recycle(_effectUI2);
-            _effectUI2 = null;
 
             if (_valueBarController != null)
             {
@@ -255,6 +253,10 @@ namespace GFGGame
             //holder.visible = boxId != LuckyBoxDataManager.BOX_ID_3;
             comBox.m_comLuckBoxBtn.m_holder.visible = boxId != LuckyBoxDataManager.BOX_ID_3;
 
+            if (_effectUI2 != null) {
+                EffectUIPool.Recycle(_effectUI2);
+                _effectUI2 = null;
+            }
             //_effectUI1 = EffectUIPool.CreateEffectUI(holder, "ui_LuckyBox", "Button_Glow");
             _effectUI2 = EffectUIPool.CreateEffectUI(comBox.m_comLuckBoxBtn.m_holder, "ui_LuckyBox", "but_text_dc");
 
@@ -546,6 +548,10 @@ namespace GFGGame
         protected override void OnHide()
         {
             base.OnHide();
+
+            EffectUIPool.Recycle(_effectUI2);
+            _effectUI2 = null;
+
             _valueBarController.OnHide();
             foreach (int key in _lcukyBoxCtrl.Keys)
             {