ソースを参照

摘星界面第二次进入特效卡死报错问题

huangxiaoyue 1 年間 前
コミット
1286bb1188

+ 13 - 11
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxStarView.cs

@@ -56,6 +56,18 @@ namespace GFGGame
         }
         protected override void OnHide()
         {
+            base.OnHide();
+            for (int i = 0; i < dicEffect.Count; i++)
+            {
+                EffectUIPool.Recycle(dicEffect[i]);
+                dicEffect[i] = null;
+            }
+            for (int i = 0; i < effObj.Count; i++)
+            {
+                EffectUIPool.Recycle(effObj[i]);
+                effObj[i] = null;
+            }
+
             int index = 0;
             GObject star = _ui.target.GetChild(string.Format("comStar{0}_{1}_{2}", _ui.m_ctrlBuyType.selectedIndex, _ui.m_ctrlRewardsType.selectedIndex, index));
             while (star != null && star.visible == true)
@@ -71,16 +83,6 @@ namespace GFGGame
                 star = _ui.target.GetChild(string.Format("comStar{0}_{1}_{2}", _ui.m_ctrlBuyType.selectedIndex, _ui.m_ctrlRewardsType.selectedIndex, index));
                 UI_ComStar.ProxyEnd();
             }
-            for (int i = 0; i < dicEffect.Count; i++)
-            {
-                EffectUIPool.Recycle(dicEffect[i]);
-                dicEffect[i] = null;
-            }
-            for (int i = 0; i < effObj.Count; i++)
-            {
-                EffectUIPool.Recycle(effObj[i]);
-                effObj[i] = null;
-            }
             notClickComStars.Clear();
             clickComStars.Clear();
             dicEffect.Clear();
@@ -94,7 +96,7 @@ namespace GFGGame
             base.OnInit();
             _ui = UI_LuckyBoxStarUI.Create();
             this.viewCom = _ui.target;
-            isfullScreen = true;
+            //isfullScreen = true;
 
             _ui.m_btnBack.visible = false;
             _ui.m_btnBack.onClick.Add(OnClickBtnBack);