瀏覽代碼

养护奖励

zhaoyang 3 年之前
父節點
當前提交
1b355f87fa

+ 1 - 1
GameClient/Assets/Game/CSShare

@@ -1 +1 @@
-Subproject commit 7c742ea5595ef1c3ebecc9251f33fe12a6e9f9e3
+Subproject commit d21dd833ca3d5ee1ba7d8891c40da04760df54da

+ 32 - 4
GameClient/Assets/Game/HotUpdate/Data/SuitFosterDatamanager.cs

@@ -99,13 +99,17 @@ namespace GFGGame
                 for (int j = 0; j < ConstDressUpScoreType.scoreTypeList().Count; j++)
                 for (int j = 0; j < ConstDressUpScoreType.scoreTypeList().Count; j++)
                 {
                 {
                     int score = j + 1;
                     int score = j + 1;
+                    string key = score.ToString();
                     int count = ItemDataManager.GetScore(itemCfg.id, score);
                     int count = ItemDataManager.GetScore(itemCfg.id, score);
-                    if (propertyData.ContainsKey(score))
+                    if (propertyData.ContainsKey(key))
                     {
                     {
-                        count = count + (int)propertyData[score];
+                        count = count + (int)propertyData[key];
+                        propertyData[key] = count;
+                    }
+                    else
+                    {
+                        propertyData.Add(key, count);
                     }
                     }
-
-                    propertyData.Add(score, count);
                 }
                 }
             }
             }
             return propertyData;
             return propertyData;
@@ -126,5 +130,29 @@ namespace GFGGame
 
 
             return 2;
             return 2;
         }
         }
+
+        public List<SuitFosterCfg> GetSuitFosterRewards(int suitId)
+        {
+            List<SuitFosterCfg> list = new List<SuitFosterCfg>();
+            SuitFosterCfg[] cfg = SuitFosterCfgArray.Instance.GetCfgs(suitId);
+            for (int i = 0; i < cfg.Length; i++)
+            {
+                if (cfg[i].rewardsArr.Length > 0)
+                {
+                    list.Add(cfg[i]);
+                }
+            }
+
+            return list;
+        }
+        private List<SuitFosterCfg> SortRewardList(List<SuitFosterCfg> list)
+        {
+            list.Sort((SuitFosterCfg a, SuitFosterCfg b) =>
+            {
+
+                return 0;
+            });
+            return list;
+        }
     }
     }
 }
 }

+ 5 - 4
GameClient/Assets/Game/HotUpdate/Views/ClothingFoster/SuitRewardView.cs

@@ -30,7 +30,7 @@ namespace GFGGame
         {
         {
             base.OnShown();
             base.OnShown();
             _suitId = (int)this.viewData;
             _suitId = (int)this.viewData;
-            _ui.m_listReward.numItems = SuitFosterCfgArray.Instance.GetCfgs(_suitId).Length;
+            _ui.m_listReward.numItems = SuitFosterDataManager.Instance.GetSuitFosterRewards(_suitId).Count;
         }
         }
 
 
         protected override void OnHide()
         protected override void OnHide()
@@ -41,11 +41,12 @@ namespace GFGGame
         private void ListRewardRecder(int index, GObject obj)
         private void ListRewardRecder(int index, GObject obj)
         {
         {
             UI_ListRewardItem item = UI_ListRewardItem.Proxy(obj);
             UI_ListRewardItem item = UI_ListRewardItem.Proxy(obj);
-            SuitFosterCfg cfg = SuitFosterCfgArray.Instance.GetCfgs(_suitId)[index];
             item.m_txtDiscribe.text = string.Format("完成套装{0}获得", SuitFosterDataManager.Instance.stepNames[index]);
             item.m_txtDiscribe.text = string.Format("完成套装{0}获得", SuitFosterDataManager.Instance.stepNames[index]);
+            // SuitFosterCfg cfg = SuitFosterCfgArray.Instance.GetCfgs(_suitId)[index];
+            int[][] rewardsArr = (int[][])SuitFosterDataManager.Instance.GetSuitFosterRewards(_suitId)[index];
             ItemData itemData = new ItemData();
             ItemData itemData = new ItemData();
-            itemData.id = cfg.rewardsArr[0][0];
-            itemData.num = cfg.rewardsArr[0][1];
+            itemData.id = rewardsArr[0][0];
+            itemData.num = rewardsArr[0][1];
             if (obj.data == null)
             if (obj.data == null)
             {
             {
                 obj.data = new ItemView(item.m_ComReward);
                 obj.data = new ItemView(item.m_ComReward);

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/ClothingFoster/SuitView.cs

@@ -154,7 +154,7 @@ namespace GFGGame
         private void ListPropertyItemRender(int index, GObject obj)
         private void ListPropertyItemRender(int index, GObject obj)
         {
         {
             UI_ListPropertyItem item = UI_ListPropertyItem.Proxy(obj);
             UI_ListPropertyItem item = UI_ListPropertyItem.Proxy(obj);
-            int score = index + 1;
+            string score = (index + 1).ToString();
             item.m_txtProperty.text = _propertyList[score].ToString();
             item.m_txtProperty.text = _propertyList[score].ToString();
             item.m_loaIcon.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + (score));
             item.m_loaIcon.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + (score));
         }
         }