void CreatePetRenderTexture(int resID) { if (m_petRTObj != null) { m_petRTObj.Release(); m_petRTObj = null; } m_petRTObj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj(resID, 750); if (null == m_petRTObj) { return; } ModeDiplayDataBase modelDisp = GameTableManager.Instance.GetTableItem <ModeDiplayDataBase>((uint)resID); if (modelDisp == null) { Engine.Utility.Log.Error("模型ID为{0}的模型展示数据为空", resID); return; } m_petRTObj.SetDisplayCamera(modelDisp.pos750, modelDisp.rotate750, modelDisp.Modelrotation); m_petRTObj.PlayModelAni(Client.EntityAction.Stand); UIRenderTexture rt = m__modelTexture.GetComponent <UIRenderTexture>(); if (null == rt) { rt = m__modelTexture.gameObject.AddComponent <UIRenderTexture>(); } if (null != rt) { rt.SetDepth(0); rt.Initialize(m_petRTObj, m_petRTObj.YAngle, new UnityEngine.Vector2(750, 750)); } }
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)); } }
/// <summary> /// 通过[ID]二分快速查表 /// </summary> /// <param name="modeID">ID</param> /// <returns></returns> public static ModeDiplayDataBase Query(this List <ModeDiplayDataBase> sorted, uint modeID) { var key = new ModeDiplayDataBase() { modeID = modeID }; var comparer = new Comparer1(); var index = sorted.BinarySearch(key, comparer); return(index >= 0 ? sorted[index] : default(ModeDiplayDataBase)); }
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)); } } }
void InitRt() { RideData data = m_rideMgr.GetRideDataById(m_rideMgr.Auto_Ride); if (data == null) { if (m_KnightRTObj != null) { m_KnightRTObj.Release(); } return; } if (rtBaseID != data.modelid) { rtBaseID = data.modelid; if (m_KnightRTObj != null) { m_KnightRTObj.Release(); } m_KnightRTObj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj((int)rtBaseID, 750); if (m_KnightRTObj == null) { return; } ModeDiplayDataBase modelDisp = GameTableManager.Instance.GetTableItem <ModeDiplayDataBase>(rtBaseID); if (modelDisp == null) { Engine.Utility.Log.Error("BOSS模型ID为{0}的模型展示数据为空", rtBaseID); return; } m_KnightRTObj.SetDisplayCamera(modelDisp.pos750, modelDisp.rotate750, modelDisp.Modelrotation); m_KnightRTObj.PlayModelAni(Client.EntityAction.Stand); UIRenderTexture rt = m__rideModel2.GetComponent <UIRenderTexture>(); if (null == rt) { rt = m__rideModel2.gameObject.AddComponent <UIRenderTexture>(); } if (null != rt) { rt.SetDepth(0); rt.Initialize(m_KnightRTObj, m_KnightRTObj.YAngle, new UnityEngine.Vector2(750, 750)); } } }
void RefreshTexture(PetDataBase db) { InitControls(); m_pdb = db; OnPlayAudio(null); if (db != null) { if (null != m__CharacterRenderTexture) { if (characterRenderobj != null) { characterRenderobj.Release(); } characterRenderobj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj((int)db.viewModelID, 512); if (characterRenderobj == null) { Engine.Utility.Log.Error("宠物模型id{0}创建贴图失败!", db.viewModelID); return; } DataManager.Manager <PetDataManager>().AddRenderObj(db.viewModelID, characterRenderobj); ModeDiplayDataBase modelDisp = GameTableManager.Instance.GetTableItem <ModeDiplayDataBase>(db.viewModelID); if (modelDisp == null) { Engine.Utility.Log.Error("宠物模型ID为{0}的模型展示数据为空", db.viewModelID); return; } characterRenderobj.SetDisplayCamera(modelDisp.pos512, modelDisp.rotate512, modelDisp.Modelrotation); characterRenderobj.PlayModelAni(Client.EntityAction.Stand); UIRenderTexture rt = m__CharacterRenderTexture.GetComponent <UIRenderTexture>(); if (null == rt) { rt = m__CharacterRenderTexture.gameObject.AddComponent <UIRenderTexture>(); } if (null != rt) { rt.SetDepth(0); rt.Initialize(characterRenderobj, characterRenderobj.YAngle, new Vector2(512, 512)); } } } }
void ShowModel(HuntingDataBase data) { string[] monID = data.monsterID.Split('_'); uint monsterid = uint.Parse(monID[0]); table.NpcDataBase npcData = GameTableManager.Instance.GetTableItem <NpcDataBase>(monsterid); if (npcData != null) { uint modelID = npcData.dwViewModelSet; // 使用观察模型 if (m_RTObj != null) { m_RTObj.Release(); m_RTObj = null; } m_RTObj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj((int)modelID, 800); if (m_RTObj == null) { return; } ModeDiplayDataBase modelDisp = GameTableManager.Instance.GetTableItem <ModeDiplayDataBase>(modelID); if (modelDisp == null) { Engine.Utility.Log.Error("BOSS模型ID为{0}的模型展示数据为空", modelID); return; } m_RTObj.SetDisplayCamera(modelDisp.pos800, modelDisp.rotate800, modelDisp.Modelrotation); m_RTObj.PlayModelAni(Client.EntityAction.Stand); UIRenderTexture rt = m__Model.GetComponent <UIRenderTexture>(); if (null == rt) { rt = m__Model.gameObject.AddComponent <UIRenderTexture>(); } if (null != rt) { rt.SetDepth(3); rt.Initialize(m_RTObj, m_RTObj.YAngle, new UnityEngine.Vector2(800, 800)); } } }
private void InitPropetyUI(RideData data) { m_rideid = 0; if (data != null) { m_rideid = data.id; UpdateFightState(); if (m_label_Ride_Name != null) { m_label_Ride_Name.text = data.name; } if (m_label_level != null) { m_label_level.text = data.level.ToString(); } if (m_label_RideSpeedLabel != null) { m_label_RideSpeedLabel.text = "速度+" + data.GetSpeed().ToString() + "%"; } if (m_label_life != null) { m_label_life.text = data.life.ToString(); } //m_btn_btn_diuqi.gameObject.SetActive(data.life <= 0); //m_btn_btn_seal.gameObject.SetActive(data.life > 0); if (m_label_Repletion != null) { m_label_Repletion.text = data.repletion.ToString() + "/" + data.maxRepletion; } table.RideFeedData maxFeedata = GameTableManager.Instance.GetTableItem <table.RideFeedData>(data.baseid, data.level + 1); if (maxFeedata != null) { table.RideFeedData feedata = GameTableManager.Instance.GetTableItem <table.RideFeedData>(data.baseid, data.level); if (feedata != null) { m_label_maxLevel.enabled = false; // m_btn_btn_addExp.gameObject.SetActive(true); // m_label_expLabel.gameObject.SetActive(true); //// m_slider_ExpSlider.gameObject.SetActive(true); // m_label_expLabel.text = string.Format("{0}/{1}", data.exp, feedata.upExp); // m_slider_ExpSlider.value = data.exp * 1.0f / feedata.upExp; } } else { m_label_maxLevel.enabled = true; m_btn_btn_addExp.gameObject.SetActive(false); m_label_expLabel.gameObject.SetActive(false); m_slider_ExpSlider.gameObject.SetActive(false); } if (baseRideId != data.modelid) { baseRideId = data.modelid; if (m_RTObj != null) { m_RTObj.Release(); } m__rideModel.gameObject.SetActive(true); m_RTObj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj((int)baseRideId, 750); if (m_RTObj == null) { return; } ModeDiplayDataBase modelDisp = GameTableManager.Instance.GetTableItem <ModeDiplayDataBase>(baseRideId); if (modelDisp == null) { Engine.Utility.Log.Error("BOSS模型ID为{0}的模型展示数据为空", baseRideId); return; } m_RTObj.SetDisplayCamera(modelDisp.pos750, modelDisp.rotate750, 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(750, 750)); } } } }