private void UpdateMyPet() { var petVo = PetMode.Instance.GetFightPetVo(); if (petVo == null && MyPetDisplay != null) { Object.Destroy(MyPetDisplay.GoBase); MyPetDisplay = null; } else { CreateMyPet(); } }
public void CreateMyPet() { if (MyPetDisplay == null) { var petVo = PetMode.Instance.GetFightPetVo(); if (petVo != null && AppMap.Instance.MeControler() != null) { var target = AppMap.Instance.MeControler().transform.position; petVo.X = target.x - 0.5f; petVo.Y = target.y; petVo.ModelLoadCallBack = LoadPetCallback; petVo.MasterVo = MeVo.instance; petVo.MasterDisplay = AppMap.Instance.me; MyPetDisplay = AppMap.Instance.CreatePet(petVo); } } }
/**创建宠物**/ public PetDisplay CreatePet(DisplayVo vo) { if (vo == null) { return(null); } vo.Type = DisplayType.PET; var display = new PetDisplay(); _petDisplayList.Add(display); objectList.Add(display); PetVo pet = (PetVo)vo; string res = pet.SysPet.res; if (res.Equals("0")) { res = "10004"; } vo.ClothUrl = "Model/Pet/" + res + "/Model/" + res + ".assetbundle"; display.SetVo(vo); return(display); }
public void Clear() { MyPetDisplay = null; }