void OnShowPetTexture(table.PetDataBase petdb) { if (m_RTObj_Pet != null) { m_RTObj_Pet.Release(); } m_RTObj_Pet = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj((int)petdb.modelID, 512); if (m_RTObj_Pet == null) { return; } // float rotateY = 170f; ModeDiplayDataBase modelDisp = GameTableManager.Instance.GetTableItem <ModeDiplayDataBase>(petdb.modelID); if (modelDisp == null) { Engine.Utility.Log.Error("宠物模型ID为{0}的模型展示数据为空", petdb.modelID); return; } m_RTObj_Pet.SetDisplayCamera(modelDisp.pos512, modelDisp.rotate512, modelDisp.Modelrotation); m_RTObj_Pet.PlayModelAni(Client.EntityAction.Stand); UIRenderTexture rt = m__PetModel.GetComponent <UIRenderTexture>(); if (null == rt) { rt = m__PetModel.gameObject.AddComponent <UIRenderTexture>(); } if (null != rt) { rt.SetDepth(0); rt.Initialize(m_RTObj_Pet, m_RTObj_Pet.YAngle, new Vector2(512, 512)); } }
void OnShowPetUI(GameCmd.PetData petData) { if (petData == null) { return; } OnShowPetProp(petData); table.PetDataBase petdb = GameTableManager.Instance.GetTableItem <table.PetDataBase>((uint)petData.base_id); if (petdb == null) { return; } OnShowPetTexture(petdb); OnShowSkills(petData.skill_list); if (!string.IsNullOrEmpty(petData.name)) { m_label_petshowname.text = petData.name; } else { m_label_petshowname.text = petdb.petName; } m_label_typeName.text = petdb.attackType; m_label_fightingLabel.text = petData.attr.fight_power.ToString(); }
public string GetPetName(IPet pet) { table.PetDataBase petdb = GetPetDataBase(pet.PetBaseID); if (petdb != null) { int status = pet.GetProp((int)PetProp.PetGuiYuanStatus); string name = pet.GetName(); if (name.Length == 0) { name = petdb.petName; } if (status == 1) { return(ColorManager.GetColorString(ColorType.JZRY_Whitle, name)); } else if (status == 2) { return(ColorManager.GetColorString(ColorType.JZRY_Green, name)); } else if (status == 3) { return(ColorManager.GetColorString(ColorType.JZRY_Blue, name)); } else if (status == 4) { return(ColorManager.GetColorString(ColorType.JZRY_Purple, name)); } else if (status == 5) { return(ColorManager.GetColorString(ColorType.JZRY_Oranger, name)); } } return(""); }
void OnShowPetProp(GameCmd.PetData petData) { table.PetUpGradeDataBase petupgrade = GameTableManager.Instance.GetTableItem <table.PetUpGradeDataBase>((uint)petData.lv, (int)petData.base_id); if (petupgrade == null) { Engine.Utility.Log.Error("PetUpGradeDataBase null id {0}", petData.base_id); return; } foreach (var item in m_dicLabls_Pet) { switch (item.Key) { case PetLabelEnum.Level: item.Value.text = petData.lv.ToString(); break; case PetLabelEnum.Character: item.Value.text = DataManager.Manager <PetDataManager>().GetPetCharacterStr(petData.character); break; case PetLabelEnum.CarryLevel: table.PetDataBase petdb = GameTableManager.Instance.GetTableItem <table.PetDataBase>((uint)petData.base_id); if (petdb != null) { item.Value.text = petdb.carryLevel.ToString(); } break; case PetLabelEnum.GrowStatus: item.Value.text = DataManager.Manager <PetDataManager>().GetGrowStatus(petData.grade); break; case PetLabelEnum.Cultivation: item.Value.text = petData.yh_lv.ToString(); break; case PetLabelEnum.Hp: item.Value.text = petData.hp.ToString(); break; case PetLabelEnum.MATK: item.Value.text = petData.attr.mdam.ToString(); break; case PetLabelEnum.PATK: item.Value.text = petData.attr.pdam.ToString(); break; case PetLabelEnum.IceDEF: item.Value.text = (petData.attr.biochdef + petData.attr.mdef).ToString(); break; case PetLabelEnum.PDEF: item.Value.text = petData.attr.pdef.ToString(); break; case PetLabelEnum.ElectricDEF: item.Value.text = (petData.attr.lightdef + petData.attr.mdef).ToString(); break; case PetLabelEnum.FireDEF: item.Value.text = (petData.attr.heatdef + petData.attr.mdef).ToString(); break; case PetLabelEnum.DarkDEF: item.Value.text = (petData.attr.wavedef + petData.attr.mdef).ToString(); break; case PetLabelEnum.PowerTallent: item.Value.text = petData.cur_talent.liliang.ToString(); break; case PetLabelEnum.Power: item.Value.text = (petData.attr_point.liliang + petupgrade.power).ToString(); break; case PetLabelEnum.AgileTallent: item.Value.text = petData.cur_talent.minjie.ToString(); break; case PetLabelEnum.Agile: item.Value.text = (petData.attr_point.minjie + petupgrade.minjie).ToString(); break; case PetLabelEnum.IntellectTallent: item.Value.text = petData.cur_talent.zhili.ToString(); break; case PetLabelEnum.Intellect: item.Value.text = (petData.attr_point.zhili + petupgrade.zhili).ToString(); break; case PetLabelEnum.StrengthTallent: item.Value.text = petData.cur_talent.tizhi.ToString(); break; case PetLabelEnum.Strength: item.Value.text = (petData.attr_point.tizhi + petupgrade.tizhi).ToString(); break; case PetLabelEnum.SpiritTallent: item.Value.text = petData.cur_talent.jingshen.ToString(); break; case PetLabelEnum.Spirit: item.Value.text = (petData.attr_point.jingshen + petupgrade.jingshen).ToString(); break; case PetLabelEnum.PCrit: item.Value.text = string.Format("{0}%", petData.attr.plucky / 100.0f); break; case PetLabelEnum.HitRate: item.Value.text = string.Format("{0}%", petData.attr.hit / 100.0f); break; case PetLabelEnum.MCrit: item.Value.text = string.Format("{0}%", petData.attr.mlucky / 100.0f); break; case PetLabelEnum.Miss: item.Value.text = string.Format("{0}%", petData.attr.hide / 100.0f); break; case PetLabelEnum.Max: break; default: break; } } }