void AddRide(GameCmd.RideData data) { table.RideDataBase tabledata = GameTableManager.Instance.GetTableItem <table.RideDataBase>(data.base_id); if (tabledata != null) { m_lstRideData.Add(new RideData() { id = data.id, // level = data.level, // life = data.life, //exp = data.exp, //fight_power = data.fight_power, // repletion = data.repletion, //skill_ids = data.skill_list, baseid = data.base_id, name = tabledata.name, icon = tabledata.icon.ToString(), modelid = tabledata.resid, spellTime = tabledata.spellTime, quality = tabledata.quality, maxRepletion = tabledata.maxRepletion, subLife = tabledata.subLife, modelScale = tabledata.modelScale * 0.01f, }); } else { Engine.Utility.Log.Error("Not Found ride data id:{0}", data.id); } }
void OnShowRideUI(RideData data) { m_label_level.text = DataManager.Manager <RideManager>().GetRideQualityStr(data.quality); m_label_Ride_Name.text = data.name; m_label_speed.text = data.GetSpeed().ToString() + "%"; if (data.skill_ids != null) { OnShowRideSkill(data.skill_ids); } if (m_nModelId == data.modelid) { return; } if (m_RTObj_Ride != null) { m_RTObj_Ride.Release(); } m_nModelId = (int)data.modelid; m_RTObj_Ride = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj(m_nModelId, 512); if (m_RTObj_Ride == null) { return; } table.RideDataBase rideData = GameTableManager.Instance.GetTableItem <table.RideDataBase>(data.baseid); if (rideData == null) { return; } ModeDiplayDataBase modelDisp = GameTableManager.Instance.GetTableItem <ModeDiplayDataBase>(rideData.viewresid); if (modelDisp == null) { Engine.Utility.Log.Error("坐骑模型ID为{0}的模型展示数据为空", rideData.viewresid); return; } m_RTObj_Ride.SetDisplayCamera(modelDisp.pos512, modelDisp.rotate512, modelDisp.Modelrotation); m_RTObj_Ride.PlayModelAni(Client.EntityAction.Stand); // //设置人物旋转 // m_RTObj_Ride.SetModelRotateY(rotateY); // m_RTObj_Ride.SetModelScale(data.modelScale); // //人物 UIRenderTexture rt = m__rideModel.GetComponent <UIRenderTexture>(); if (null == rt) { rt = m__rideModel.gameObject.AddComponent <UIRenderTexture>(); } if (null != rt) { rt.SetDepth(0); rt.Initialize(m_RTObj_Ride, m_RTObj_Ride.YAngle, new Vector2(512, 512)); } }
protected override void OnShow(object data) { base.OnShow(data); if (data is table.RideDataBase) { table.RideDataBase database = data as table.RideDataBase; // m_label_name.text = "坐骑详细"; m_label_rarity.text = DataManager.Manager <RideManager>().GetRideQualityStr(database.quality); m_label_showname.text = database.name; table.RideFeedData feeddata = GameTableManager.Instance.GetTableItem <table.RideFeedData>(database.rideID, 0); if (feeddata != null) { float value = (feeddata.speed / 100.0f); m_label_speed.text = value.ToString() + "%"; } m_label_getway.text = database.getWay; if (m_RTObj != null) { m_RTObj.Release(); } m_RTObj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj((int)database.viewresid, 512); if (m_RTObj == null) { return; } ModeDiplayDataBase modelDisp = GameTableManager.Instance.GetTableItem <ModeDiplayDataBase>(database.viewresid); if (modelDisp == null) { Engine.Utility.Log.Error("BOSS模型ID为{0}的模型展示数据为空", database.viewresid); return; } m_RTObj.SetDisplayCamera(modelDisp.pos512, modelDisp.rotate512, modelDisp.Modelrotation); m_RTObj.PlayModelAni(Client.EntityAction.Stand); UIRenderTexture rt = m__RideModel.GetComponent <UIRenderTexture>(); if (null == rt) { rt = m__RideModel.gameObject.AddComponent <UIRenderTexture>(); } if (null != rt) { rt.SetDepth(0); rt.Initialize(m_RTObj, m_RTObj.YAngle, new UnityEngine.Vector2(512, 512)); } } }
private void OnRideUI(uint baseId, uint level, UILabel[] labels) { m_label_petGradeValue.text = string.Format("速度加成: {0}%", RideData.GetSpeedById_Level(baseId, (int)level)); m_label_petLift.text = ""; m_label_petCharacter.text = ""; m_label_variableLevel.text = ""; m_label_InheritingNumber.text = ""; for (int i = 0; i < skillLabels.Length; i++) { skillLabels[i].enabled = false; } uint ride_life = 0; for (int i = 0; i < m_itemServer.numbers.Count; i++) { GameCmd.PairNumber pn = m_itemServer.numbers[i]; GameCmd.eItemAttribute bute = (GameCmd.eItemAttribute)pn.id; switch (bute) { case GameCmd.eItemAttribute.Item_Attribute_Ride_Level: break; case GameCmd.eItemAttribute.Item_Attribute_Ride_Life: ride_life = pn.value; break; case GameCmd.eItemAttribute.Item_Attribute_Ride_Skill: table.RideSkillData skilldata = GameTableManager.Instance.GetTableItem <table.RideSkillData>(baseId, (int)level); if (skilldata != null) { for (int n = 0; n < skilldata.skillArray.Count; n++) { labels[n].enabled = true; table.RideSkillDes rideSkillDes = GameTableManager.Instance.GetTableItem <table.RideSkillDes>(skilldata.skillArray[n]); if (rideSkillDes != null) { labels[n].text = rideSkillDes.skillName; } } } break; case GameCmd.eItemAttribute.Item_Attribute_Ride_Base_Id: table.RideDataBase ridedata = GameTableManager.Instance.GetTableItem <table.RideDataBase>(pn.value); if (ridedata != null) { m_label_name.text = ridedata.name; //DataManager.Manager<UIManager>().SetSpriteDynamicIcon(m_sprite_icon, ridedata.icon, true); UIManager.GetTextureAsyn(ridedata.icon, ref m_curIconAsynSeed, () => { if (null != m__icon) { m__icon.mainTexture = null; } }, m__icon); if (null != m_sprite_qulity) { UIManager.GetQualityAtlasAsyn(ridedata.quality, ref m_curBordernAsynSeed, () => { if (null != m_sprite_qulity) { m_sprite_qulity.atlas = null; } }, m_sprite_qulity); } m_label_Label_2.text = string.Format("品质: {0}", DataManager.Manager <RideManager>().GetRideQualityStr(ridedata.quality)); } break; default: break; } } m_label_petYhLv.text = string.Format("寿命: {0}", ride_life); }