public void SetUI(MineInfo mineInfo, int index) { MinePetInfo mpi = ElementInstanceManager.Instance.m_elementCopyLoginPush.minePetInfos.get_Item(index); this.m_blockID = mpi.blockId; BlockInfo blockInfo = ElementInstanceManager.Instance.m_elementCopyLoginPush.activateBlocks.Find((BlockInfo a) => a.blockId == mpi.blockId); YKuangJingKu yKuangJingKu = DataReader <YKuangJingKu> .Get(blockInfo.incidentTypeId); this.TextMineName.set_text(yKuangJingKu.holdName); ResourceManager.SetSprite(this.ImageProduceIcon, GameDataUtils.GetIcon(DataReader <Items> .Get(yKuangJingKu.item.get_Item(0)).icon)); PetInfo petInfo = PetManager.Instance.GetPetInfo(mpi.petId); int num = 0; this.TextMineTime.set_text(TimeConverter.ChangeSecsToString(ElementInstanceManager.Instance.GetTimeCal(mineInfo.blockId))); if (DataReader <Pet> .Get(petInfo.petId).element == yKuangJingKu.petType) { num = yKuangJingKu.petStar.get_Item(petInfo.star - 1); } this.TextProduceValue.set_text((mineInfo.debrisInfos == null || mineInfo.debrisInfos.get_Count() <= 0) ? "0" : mineInfo.debrisInfos.get_Item(0).debrisNum.ToString()); this.TextProduceNum.set_text((yKuangJingKu.itemAddTime.get_Item(0) + num).ToString() + "/小时"); ResourceManager.SetSprite(this.ImagePetIcon, PetManager.Instance.GetSelfPetIcon(petInfo.petId)); ResourceManager.SetSprite(this.ImageMine, GameDataUtils.GetIcon(yKuangJingKu.icon)); if (mineInfo.debrisInfos.get_Count() == 0) { ImageColorMgr.SetImageColor(this.BtnGet.get_transform().FindChild("Image").GetComponent <Image>(), true); this.BtnGet.set_enabled(false); } else { ImageColorMgr.SetImageColor(this.BtnGet.get_transform().FindChild("Image").GetComponent <Image>(), false); this.BtnGet.set_enabled(true); } }
private void RefreshDes() { MinePetInfo minePetInfo = ElementInstanceManager.Instance.m_elementCopyLoginPush.minePetInfos.Find((MinePetInfo a) => a.blockId == this.blockID); BlockInfo blockInfo = ElementInstanceManager.Instance.m_elementCopyLoginPush.activateBlocks.Find((BlockInfo a) => a.blockId == this.blockID); YKuangJingKu yKuangJingKu = DataReader <YKuangJingKu> .Get(blockInfo.incidentTypeId); this.TextMineName.set_text(yKuangJingKu.holdName); string text = GameDataUtils.GetChineseContent(502311, false); text = text.Replace("{s1}", yKuangJingKu.itemAddTime.get_Item(0).ToString()); Debug.LogError(string.Concat(new object[] { ElementInstanceManager.Instance.m_elementCopyLoginPush.minePetInfos.get_Count(), "===============", this.blockID, "============", minePetInfo })); int num = 0; if (minePetInfo != null) { PetInfo petInfo = PetManager.Instance.GetPetInfo(minePetInfo.petId); if (DataReader <Pet> .Get(petInfo.petId).element == yKuangJingKu.petType) { num = yKuangJingKu.petStar.get_Item(petInfo.star - 1); } } this.TextProduce.set_text((yKuangJingKu.itemAddTime.get_Item(0) + num).ToString() + GameDataUtils.GetChineseContent(502318, false)); Debug.LogError("data.item[0] " + yKuangJingKu.item.get_Item(0)); ResourceManager.SetSprite(this.ImageMineProduce, GameDataUtils.GetIcon(DataReader <Items> .Get(yKuangJingKu.item.get_Item(0)).icon)); ResourceManager.SetSprite(this.ImageMineIcon, GameDataUtils.GetIcon(yKuangJingKu.icon)); }