zhaoyang 2 years ago
parent
commit
e3ca89c5e3

+ 20 - 2
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxBonusShowView.cs

@@ -49,9 +49,19 @@ namespace GFGGame
         {
             base.OnShown();
             _rewardList.AddRange(this.viewData as List<ItemData>);
-            _ui.m_c1.selectedIndex = _rewardList.Count == 1 ? 0 : 1;
             _effectIndex = 0;
-
+            if (_rewardList.Count == 1)
+            {
+                _ui.m_c1.selectedIndex = 0;
+                UpdateItem(_ui.m_itemOne.target, 0);
+            }
+            else
+            {
+                for (int i = 0; i < _rewardList.Count; i++)
+                {
+                    UpdateItem(_ui.target.GetChild("item" + i).asCom, i);
+                }
+            }
         }
 
         protected override void OnHide()
@@ -86,6 +96,14 @@ namespace GFGGame
                 }
                 _effectIndex++;
             }
+            int count = 0;
+            bool isFirst = false;
+            for (int i = 0; i < _rewardList.Count; i++)
+            {
+                if (_rewardList[i].id == itemData.id) count++;
+                if (count == 1 && i == index) isFirst = true;
+            }
+            item.m_comIcon.m_imgNew.visible = count == ItemDataManager.GetItemNum(itemData.id) && isFirst;
 
             UI_LuckyBoxBonusShowItem.ProxyEnd();
         }