public DayDungeonBaseData(JsonData jsonData) { id = jsonData["id"].ToString(); name = jsonData["name"].ToString(); buffID = jsonData["buffID"].ToStringJ(); string key = ""; for (int i = 1; i < 6; i++) { key = "monsterID_" + i; string monsterID = jsonData[key].ToStringJ(); if (string.IsNullOrEmpty(monsterID)) { continue; } else { DayDungeonMonsterData data = new DayDungeonMonsterData(); data.id = monsterID; key = "amount_" + i; data.amount = jsonData[key].ToInt(); key = "maxHp_" + i; data.maxHp = jsonData[key].ToDouble(); key = "attackPower_" + i; data.attackPower = jsonData[key].ToDouble(); key = "defensePower_" + i; data.defensePower = jsonData[key].ToDouble(); monsterList.Add(data); } } key = "bossID"; string bossID = jsonData[key].ToStringJ(); if (string.IsNullOrEmpty(bossID) == false) { bossData = new DayDungeonMonsterData(); bossData.id = bossID; key = "maxHp"; bossData.maxHp = jsonData[key].ToDouble(); key = "attackPower"; bossData.attackPower = jsonData[key].ToDouble(); key = "defensePower"; bossData.defensePower = jsonData[key].ToDouble(); } rewardID = jsonData["rewardID"].ToStringJ(); rewardAmont = jsonData["rewardAmount"].ToDouble(); }
public static void InitBlueTeam() { blueTeamDataList.Clear(); string key = UIDayDungeonLobby.Instance.currentTapDay.ToString() + "_" + UIDayDungeonLobby.Instance.dungeonLevel; if (GameDataManager.dayDungeonBaseDataDic.ContainsKey(key)) { DayDungeonBaseData data = GameDataManager.dayDungeonBaseDataDic[key]; for (int i = 0; i < data.monsterList.Count; i++) { DayDungeonMonsterData monster = data.monsterList[i]; for (int j = 0; j < monster.amount; j++) { if (GameDataManager.heroBaseDataDic.ContainsKey(monster.id)) { HeroBaseData heroBaseData = GameDataManager.heroBaseDataDic[monster.id]; HeroData hero = new HeroData(heroBaseData); hero.InitTestData(heroBaseData.id, monster.maxHp, monster.attackPower, monster.defensePower); blueTeamDataList.Add(hero); } else { Debug.LogError(monster.id + " - 이런 아이디 없음"); } } } if (data.bossData != null) { DayDungeonMonsterData boss = data.bossData; if (GameDataManager.heroBaseDataDic.ContainsKey(boss.id)) { HeroBaseData heroBaseData = GameDataManager.heroBaseDataDic[boss.id]; HeroData hero = new HeroData(heroBaseData); hero.InitTestData(heroBaseData.id, boss.maxHp, boss.attackPower, boss.defensePower); blueTeamDataList.Add(hero); } else { Debug.LogError(boss.id + " - 이런 아이디 없음"); } } } }