IEnumerator InitMoneyBaseData() { JsonData json = null; moneyBaseDataDic = new Dictionary <string, MoneyBaseData>(); yield return(StartCoroutine(AssetLoader.LoadJsonData("data/money", "MoneyBaseData", x => json = x))); for (int i = 0; i < json.Count; i++) { MoneyBaseData data = new MoneyBaseData(json[i]); moneyBaseDataDic.Add(data.id, data); } }
IEnumerator ShowCoroutine() { string key = currentTapDay.ToString() + "_" + dungeonLevel; //Debug.Log(key); if (GameDataManager.dayDungeonBaseDataDic.ContainsKey(key)) { DayDungeonBaseData data = GameDataManager.dayDungeonBaseDataDic[key]; textDungeonName.text = data.name; if (string.IsNullOrEmpty(data.bossData.id) == false) { if (bossObj != null) { bossObj.SetActive(false); bossObj.transform.SetParent(CharacterEmptyPool.Instance.transform); } GameObject go = null; yield return(StartCoroutine(CharacterEmptyPool.Instance.GetHero(data.bossData.id, x => go = x))); bossObj = go; bossObj.transform.position = pivot.position; bossObj.transform.SetParent(pivot); bossObj.transform.localScale = Vector3.one; //bossObj.SetActive(true); } for (int i = 0; i < monsterSlotList.Count; i++) { monsterSlotList[i].InitSlot(); } for (int i = 0; i < data.monsterList.Count; i++) { string monsterID = data.monsterList[i].id; int amount = data.monsterList[i].amount; if (GameDataManager.heroBaseDataDic.ContainsKey(monsterID)) { HeroBaseData heroBaseData = GameDataManager.heroBaseDataDic[monsterID]; monsterSlotList[i].InitSlot(heroBaseData, amount); } } battleStartButton.interactable = currentTapDay == BattleDayDungeonManager.today && dungeonLevel <= topLevel; if (GameDataManager.moneyBaseDataDic.ContainsKey(data.rewardID)) { MoneyBaseData moneyBase = GameDataManager.moneyBaseDataDic[data.rewardID]; AssetLoader.AssignImage(imageReward, "sptire/material", "Atlas_Material", moneyBase.spriteName); textRewardName.text = moneyBase.name; textRewardAmount.text = data.rewardAmont.ToStringABC(); } } if (bossObj != null) { bossObj.SetActive(true); } dayDungeonCanvas.enabled = true; lightPanel.SetActive(true); dayDungeonPanel.SetActive(true); showCoroutine = null; }