|
@@ -12,17 +12,17 @@ namespace GFGGame
|
|
|
{
|
|
|
StoryBonusData bonusData = GetBonusData(levelID);
|
|
|
List<ItemData> bonusList = new List<ItemData>();
|
|
|
- if(hasOnce)
|
|
|
+ if (hasOnce)
|
|
|
{
|
|
|
bonusList.AddRange(bonusData.bonusOnce);
|
|
|
}
|
|
|
- if(bonusData.bonusBase != null)
|
|
|
+ if (bonusData.bonusBase != null)
|
|
|
{
|
|
|
bonusList.AddRange(bonusData.bonusBase);
|
|
|
}
|
|
|
- if(bonusData.bonusRandom != null && bonusData.bonusRandom.Count > 0)
|
|
|
+ if (bonusData.bonusRandom != null && bonusData.bonusRandom.Count > 0)
|
|
|
{
|
|
|
- if(doRandom)
|
|
|
+ if (doRandom)
|
|
|
{
|
|
|
StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(levelID);
|
|
|
StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
|
|
@@ -41,27 +41,27 @@ namespace GFGGame
|
|
|
{
|
|
|
StoryChapterCfg chapterCfg = StoryChapterCfgArray.Instance.GetCfg(chapterID);
|
|
|
int[][] bonus = chapterCfg.bonus1Arr;
|
|
|
- if(index == 1)
|
|
|
+ if (index == 1)
|
|
|
{
|
|
|
bonus = chapterCfg.bonus2Arr;
|
|
|
}
|
|
|
- else if(index == 2)
|
|
|
+ else if (index == 2)
|
|
|
{
|
|
|
bonus = chapterCfg.bonus3Arr;
|
|
|
}
|
|
|
return ItemUtil.CreateItemDataList(bonus);
|
|
|
}
|
|
|
|
|
|
- private static StoryBonusData GetBonusData(string levelID)
|
|
|
+ public static StoryBonusData GetBonusData(string levelID)
|
|
|
{
|
|
|
StoryBonusData bonusData = null;
|
|
|
- if(!_bonusDic.ContainsKey(levelID))
|
|
|
+ if (!_bonusDic.ContainsKey(levelID))
|
|
|
{
|
|
|
bonusData = new StoryBonusData();
|
|
|
_bonusDic.Add(levelID, bonusData);
|
|
|
StoryLevelCfg levelCfg = StoryLevelCfgArray.Instance.GetCfg(levelID);
|
|
|
bonusData.bonusOnce = ItemUtil.CreateItemDataList(levelCfg.bonusOnceArr, true);
|
|
|
- if(levelCfg.fightID != null && levelCfg.fightID.Length > 0)
|
|
|
+ if (levelCfg.fightID != null && levelCfg.fightID.Length > 0)
|
|
|
{
|
|
|
StoryFightCfg fightCfg = StoryFightCfgArray.Instance.GetCfg(levelCfg.fightID);
|
|
|
bonusData.bonusBase = ItemUtil.CreateItemDataList(fightCfg.bonusBaseArr);
|