public void RefreshMineFX() { int i; for (i = 0; i < this.listFXBlockID.get_Count(); i++) { if (ElementInstanceManager.Instance.m_elementCopyLoginPush.minePetInfos.Find((MinePetInfo a) => a.blockId.Equals(this.listFXBlockID.get_Item(i))) == null) { Object.Destroy(base.get_transform().FindChild(this.listFXBlockID.get_Item(i)).FindChild("FX").get_gameObject()); this.listFXBlockID.RemoveAt(i); i--; } } for (int j = 0; j < ElementInstanceManager.Instance.m_elementCopyLoginPush.minePetInfos.get_Count(); j++) { MinePetInfo minePetInfo = ElementInstanceManager.Instance.m_elementCopyLoginPush.minePetInfos.get_Item(j); if (this.listFXBlockID.Find((string a) => a.Equals(minePetInfo.blockId)) == null) { Transform parent = base.get_transform().FindChild(minePetInfo.blockId); GameObject gameObject = Object.Instantiate <GameObject>(AssetManager.AssetOfNoPool.LoadAssetNowNoAB("GameEffect/Prefabs/tongyong/f00131", typeof(Object)) as GameObject); gameObject.SetActive(true); gameObject.get_transform().set_parent(parent); gameObject.get_transform().set_localScale(new Vector3(0.08f, 0.08f, 0.08f)); gameObject.get_transform().set_localPosition(Vector3.get_zero()); gameObject.get_transform().set_localRotation(Quaternion.Euler(90f, 0f, 0f)); gameObject.set_name("FX"); this.listFXBlockID.Add(minePetInfo.blockId); } } }
private void RefreshPet() { if (ElementInstanceManager.Instance.GetBlockInfo(this.blockID).isChallenge) { this.BtnFight.get_gameObject().SetActive(false); this.BtnChoosePet.get_gameObject().SetActive(true); this.TextDesFight.set_text(GameDataUtils.GetChineseContent(502313, false)); MinePetInfo minePetInfo = ElementInstanceManager.Instance.m_elementCopyLoginPush.minePetInfos.Find((MinePetInfo a) => a.blockId == this.blockID); if (minePetInfo != null) { this.PetIcon.get_gameObject().SetActive(true); PetInfo petInfo = PetManager.Instance.GetPetInfo(minePetInfo.petId); Pet dataPet = DataReader <Pet> .Get(petInfo.petId); ResourceManager.SetSprite(this.PetIcon.FindChild("ImageIcon").GetComponent <Image>(), PetManager.Instance.GetSelfPetIcon2(dataPet)); ResourceManager.SetSprite(this.PetIcon.FindChild("ImageFrame").GetComponent <Image>(), PetManager.GetPetFrame01(petInfo.star)); this.BtnOut.get_gameObject().SetActive(true); } else { this.PetIcon.get_gameObject().SetActive(false); this.BtnOut.get_gameObject().SetActive(false); } } else { this.TextDesFight.set_text(GameDataUtils.GetChineseContent(502314, false)); this.BtnChoosePet.get_gameObject().SetActive(false); this.BtnOut.get_gameObject().SetActive(false); this.BtnFight.get_gameObject().SetActive(true); } }
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)); }