public void SetPetInfo(int petId, int obtain_star, int decompose_star, bool exist, bool replace, string petName) { Pet pet = DataReader <Pet> .Get(petId); if (pet != null) { PetObtainUIView.Instance.SetBackground(pet.petType); this.PetName = PetManager.GetPetName(pet, obtain_star); this.PetStar = PetManager.GetPetQualityIcon(obtain_star); if (exist) { this.ShowTip = true; if (!replace) { this.TipName = string.Format(GameDataUtils.GetChineseContent(500116, false), petName, PetManager.GetReturnFragment(pet, decompose_star)); } else { this.TipName = string.Format(GameDataUtils.GetChineseContent(500117, false), petName, PetManager.GetReturnFragment(pet, decompose_star)); } } else { this.ShowTip = false; } } }
public void SetItem(PetInfo petInfo = null, Pet dataPet = null, bool islimit = false) { if (petInfo != null) { ResourceManager.SetSprite(this.m_spImageFrame, PetManager.GetPetFrame01(petInfo.star)); ResourceManager.SetSprite(this.m_spImageFramePet, PetManager.GetPetFrame02(petInfo.star)); ResourceManager.SetSprite(this.m_spImageIcon, PetManager.Instance.GetSelfPetIcon2(dataPet)); if (this.m_spImageQuality != null) { ResourceManager.SetSprite(this.m_spImageQuality, PetManager.GetPetQualityIcon(petInfo.star)); } if (this.m_lblTextPower != null) { this.m_lblTextPower.set_text(petInfo.publicBaseInfo.simpleInfo.Fighting.ToString()); } this.m_lblTextName.set_text(GameDataUtils.GetChineseContent(dataPet.name, false)); this.m_lblTextLV.GetComponent <Text>().set_text("Lv." + petInfo.lv); this.ShowHave(true); this.ShowLimit(islimit); } else { this.ShowHave(false); } }