Selaa lähdekoodia

章节宝箱预览

zhaoyang 3 vuotta sitten
vanhempi
commit
db5757b43a

+ 14 - 0
GameClient/Assets/Game/HotUpdate/Data/Cache/StoryBonusDataCache.cs

@@ -57,6 +57,20 @@ namespace GFGGame
             }
             return ItemUtil.CreateItemDataList(bonus);
         }
+        public static int GetChapterBonusStar(int chapterID, int index)
+        {
+            StoryChapterCfg chapterCfg = StoryChapterCfgArray.Instance.GetCfg(chapterID);
+            int star = chapterCfg.bonusStar1;
+            if (index == 1)
+            {
+                star = chapterCfg.bonusStar2;
+            }
+            else if (index == 2)
+            {
+                star = chapterCfg.bonusStar3;
+            }
+            return star;
+        }
 
         public static StoryBonusData GetBonusData(int levelID)
         {

+ 8 - 5
GameClient/Assets/Game/HotUpdate/Views/MainStory/StoryChapterView.cs

@@ -251,13 +251,16 @@ namespace GFGGame
                     UpdateBonusBoxStatus(bonusBox, index);
                 }
             }
-            else if (status == ConstBonusStatus.GOT)
-            {
-                PromptController.Instance.ShowFloatTextPrompt("这个宝箱已经被领取过了");
-            }
+            // else if (status == ConstBonusStatus.GOT)
+            // {
+            //     PromptController.Instance.ShowFloatTextPrompt("这个宝箱已经被领取过了");
+            // }
             else
             {
-                PromptController.Instance.ShowFloatTextPrompt("关卡总分不足,继续加油吧。");
+                List<ItemData> rewards = StoryBonusDataCache.GetChapterBonusList(_chapterID, index);
+                int star = StoryBonusDataCache.GetChapterBonusStar(_chapterID, index);
+                ViewManager.Show<RewardPreView>(new object[] { rewards, "宝箱奖励", string.Format("本章达成{0}星可领取", star) });
+                // PromptController.Instance.ShowFloatTextPrompt("关卡总分不足,继续加油吧。");
             }
         }
         private void CheckGuide(object param)