瀏覽代碼

抽卡掉落道具展示

zhaoyang 3 年之前
父節點
當前提交
05b0492198

+ 10 - 1
GameClient/Assets/Game/HotUpdate/Utils/ItemUtil.cs

@@ -114,7 +114,16 @@ namespace GFGGame
             List<ItemData> itemList = new List<ItemData>();
             foreach (int[] item in bonus)
             {
-                ItemData itemData = createItemData(item[0], item[1] * num);
+                int count = 0;
+                if (item.Length > 1)
+                {
+                    count = item[1];
+                }
+                else
+                {
+                    count = 1;
+                }
+                ItemData itemData = createItemData(item[0], count * num);
                 itemList.Add(itemData);
 
             }

+ 5 - 3
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxCardView.cs

@@ -3,6 +3,7 @@ using UnityEngine;
 using UI.LuckyBox;
 using System.Collections.Generic;
 using FairyGUI;
+using System.Linq;
 
 namespace GFGGame
 {
@@ -42,13 +43,14 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
-            _rewardList = new List<ItemData>(((this.viewData as object[])[0] as List<ItemData>));
+            _rewardList = new List<ItemData>();
 
+            List<ItemData> rewards = new List<ItemData>(((this.viewData as object[])[0] as List<ItemData>));
+            _rewardList.AddRange(rewards);
 
             int[][] bonus = LuckyBoxCfgArray.Instance.GetCfg(LuckyBoxDataManager.Instance.luckyBoxId).bonusArr;
             List<ItemData> itemDatas = ItemUtil.CreateItemDataList(bonus, LuckyBoxDataManager.Instance.times);
-            itemDatas.AddRange(_rewardList);
-            _rewardList = itemDatas;
+            _rewardList.AddRange(itemDatas);
 
             _type = (int)(this.viewData as object[])[1];
             _ui.m_btnPass.visible = _type == (int)FirstGetCardViewType.JUMP ? true : false;