huangxiaoyue 2 rokov pred
rodič
commit
1e06cf416a

+ 0 - 1
GameClient/Assets/Game/HotUpdate/Effect/EffectUI.cs

@@ -32,7 +32,6 @@ namespace GFGGame
             _gameObject.transform.localScale = new Vector3(scale, scale, scale);
             _wrapper = new GoWrapper(_gameObject);
             holder.SetNativeObject(_wrapper);
-
         }
 
 

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Effect/EffectUIPool.cs

@@ -12,6 +12,7 @@ namespace GFGGame
             EffectUI effectUI;
             if (effectUIs.Count > 0)
             {
+
                 int lastIndex = effectUIs.Count - 1;
                 effectUI = effectUIs[lastIndex];
                 effectUIs.RemoveAt(lastIndex);

+ 0 - 1
GameClient/Assets/Game/HotUpdate/Views/CommonGame/GetSuitItemVIew.cs

@@ -76,7 +76,6 @@ namespace GFGGame
             int suitId = GetSuitItemController.TryShow(0);
             if (suitId > 0)
             {
-
                 UpdateView(suitId);
             }
             else

+ 12 - 28
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxBonusShowView.cs

@@ -10,19 +10,14 @@ namespace GFGGame
     {
         private UI_LuckBoxBonusShowUI _ui;
         private List<ItemData> _rewardList = new List<ItemData>();
-        // private List<GameObject> _gameobjects = new List<GameObject>();
-        //private Dictionary<int, Dictionary<int, EffectUI>> _effList = new Dictionary<int, Dictionary<int, EffectUI>>();
         private List<EffectUI> _effList = new List<EffectUI>();
 
         private EffectUI _effectUI1;
         private EffectUI _effectUI2;
         private EffectUI _effectUI3;
-        private EffectUI _effectUI4;
 
-        private int _effectIndex = 0;
         public override void Dispose()
         {
-            base.Dispose();
             EffectUIPool.Recycle(_effectUI1);
             _effectUI1 = null;
             EffectUIPool.Recycle(_effectUI2);
@@ -30,17 +25,12 @@ namespace GFGGame
             EffectUIPool.Recycle(_effectUI3);
             _effectUI3 = null;
 
-            // for (int i = 0; i < _gameobjects.Count; i++)
-            // {
-            //     SceneController.DestroyObjectFromView(_gameobjects[i], _wrappers[i]);
-
-            // }
-
             if (_ui != null)
             {
                 _ui.Dispose();
                 _ui = null;
             }
+            base.Dispose();
         }
 
         protected override void OnInit()
@@ -66,7 +56,6 @@ namespace GFGGame
         {
             base.OnShown();
             _rewardList.AddRange(this.viewData as List<ItemData>);
-            _effectIndex = 0;
             if (_rewardList.Count == 1)
             {
                 _ui.m_c1.selectedIndex = 0;
@@ -90,12 +79,9 @@ namespace GFGGame
                 _effList[key] = null;
             }
             _effList.Clear();
-        
-            EffectUIPool.Recycle(_effectUI4);
-            _effectUI4 = null;
+            _rewardList.Clear();
 
             base.OnHide();
-            _rewardList.Clear();
             GetSuitItemController.TryShow(0);
         }
 
@@ -110,19 +96,16 @@ namespace GFGGame
             item.m_comIcon.m_icon.url = ResPathUtil.GetIconPath(itemCfg);
             RarityIconController.UpdateRarityIcon(item.m_comIcon.m_rarity, itemData.id, false);
 
-            string resPath = itemCfg.rarity == ConstDressRarity.Rarity_TIANYI ? "CK_all_01" : "CK_all_02";
-
-            if (countType == 10 && itemCfg.rarity > 2 )//&& (!_effList.ContainsKey(itemCfg.rarity) || !_effList[itemCfg.rarity].ContainsKey(index)))
-            {
-                GGraph holder = itemCfg.rarity == 3 ? item.m_comIcon.m_holder : item.m_comIcon.m_holder1;
-                EffectUI _effectUI = EffectUIPool.CreateEffectUI(holder, "ui_LuckyBox", resPath);
-                _effList.Add(_effectUI);
-            }
-            if (countType == 1 && itemCfg.rarity > 2 && _effectUI4 == null)
-            {
-                GGraph holder = itemCfg.rarity == 3 ? item.m_comIcon.m_holder : item.m_comIcon.m_holder1;
-                _effectUI4 = EffectUIPool.CreateEffectUI(holder, "ui_LuckyBox", resPath);
+            if (itemCfg.rarity > 2) { 
+                string resPath = itemCfg.rarity == ConstDressRarity.Rarity_TIANYI ? "CK_all_01" : "CK_all_02";
+                if (item != null && item.m_comIcon.m_holder != null && item.m_comIcon.m_holder1 != null)
+                {
+                    GGraph holder = itemCfg.rarity == 3 ? item.m_comIcon.m_holder : item.m_comIcon.m_holder1;
+                    EffectUI _effectUI = EffectUIPool.CreateEffectUI(holder, "ui_LuckyBox", resPath);
+                    _effList.Add(_effectUI);
+                }
             }
+
             int count = 0;
             bool isFirst = false;
             for (int i = 0; i < _rewardList.Count; i++)
@@ -137,6 +120,7 @@ namespace GFGGame
                 item.target.onClick.Add(ShowItemTips);
             }
             item.target.data = itemCfg.id;
+
             UI_LuckyBoxBonusShowItem.ProxyEnd();
         }
 

+ 9 - 8
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxNewDressView.cs

@@ -26,7 +26,6 @@ namespace GFGGame
 
         public override void Dispose()
         {
-            base.Dispose();
             EffectUIPool.Recycle(_effectUI1);
             _effectUI1 = null;
             EffectUIPool.Recycle(_effectUI2);
@@ -40,6 +39,7 @@ namespace GFGGame
                 _ui.Dispose();
                 _ui = null;
             }
+            base.Dispose();
         }
 
         protected override void OnInit()
@@ -160,17 +160,18 @@ namespace GFGGame
 
         private void OnClickBg()
         {
-            if (_newRewardList.Count == 0 && _oldRewardList.Count == 0)
-            {
-                this.Hide();
-                return;
-            }
             _ui.m_t_close.Play(() =>
             {
                 _ui.m_comCard.m_holder.visible = false;
                 _ui.m_comCard.m_holder1.visible = false;
-                _ui.m_t_open.Play();
-                UpdateView();
+                if (_newRewardList.Count == 0 && _oldRewardList.Count == 0)
+                {
+                    this.Hide();
+                }
+                else {
+                    _ui.m_t_open.Play();
+                    UpdateView();
+                }
             });
         }
         private int GetThisCount(int itemId, List<ItemData> rewards)