/// <summary> /// 显示模型 /// </summary> /// <param name="lstSuit"></param> /// <param name="nJob"></param> /// <param name="nSex"></param> /// <param name="nSize"></param> private void OnShowModelTexture(List <GameCmd.SuitData> lstSuit, int nJob, int nSex, int nSize = 700) { if (m_RTObj_Player != null) { m_RTObj_Player.Release(); } m_RTObj_Player = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj(lstSuit, nJob, nSex, nSize); if (m_RTObj_Player == null) { Engine.Utility.Log.Error("Create rt obj failed"); return; } m_RTObj_Player.SetModelRotateY(-135f); m_RTObj_Player.SetCamera(new Vector3(0, 1f, 0f), new Vector3(0, 45, 0), 4f); m_RTObj_Player.PlayModelAni(Client.EntityAction.Stand); UIRenderTexture rt = m__modelTexture.GetComponent <UIRenderTexture>(); if (null == rt) { rt = m__modelTexture.gameObject.AddComponent <UIRenderTexture>(); } if (null != rt) { rt.SetDepth(1); rt.Initialize(m_RTObj_Player, -135f, new Vector2(700f, 700f), null); } }
public void AddRenderObj(uint id, IRenerTextureObj obj) { if (!m_dicRTObjs.ContainsKey(id)) { m_dicRTObjs.Add(id, obj); } }
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 ShowModel() { int npcID = GameTableManager.Instance.GetGlobalConfig <int>("FinalTargetModelID"); table.NpcDataBase npcData = GameTableManager.Instance.GetTableItem <table.NpcDataBase>((uint)npcID); if (npcData != null) { uint modelID = npcData.dwViewModelSet; // 使用观察模型 if (m_RTObj != null) { m_RTObj.Release(); } m_RTObj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj((int)modelID, 800); if (m_RTObj == null) { return; } m_RTObj.SetCamera(new Vector3(0, 1, 0), Vector3.zero, -4.85f); m_RTObj.SetModelRotateY(rotateY); //人物 if (m__Model != null) { m__Model.mainTexture = m_RTObj.GetTexture(); m__Model.MakePixelPerfect(); } } }
void ShowModel() { int job = MainPlayerHelper.GetMainPlayerJob(); List <uint> list = GameTableManager.Instance.GetGlobalConfigList <uint>("ArtifactReward", job.ToString()); if (list.Count == 2) { uint modelID = list[1]; ShowModelDataBase data = GameTableManager.Instance.GetTableItem <ShowModelDataBase>(modelID); if (data == null) { return; } if (m_RTObj != null) { m_RTObj.Release(); } m_RTObj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj((int)modelID, 800); if (m_RTObj == null) { return; } // 0 1.52 0 7 45 0 5 m_RTObj.SetCamera(new Vector3(0, data.quanOffsetY * 0.01f, 0), Vector3.zero, -data.quanDistance * 0.01f); if (m__Model != null) { m__Model.mainTexture = m_RTObj.GetTexture(); m__Model.MakePixelPerfect(); } } }
protected override void OnHide() { base.OnHide(); if (m_RTObj != null) { m_RTObj.Release(); m_RTObj = null; } }
/// <summary> /// 释放 /// </summary> public void Release() { if (ready) { m_touchCallBack = null; ready = false; renderObj.Release(); renderObj = null; } }
//void OnDisable() //{ // if (rtObj != null) // { // rtObj.Enable(false); // rtObj.Release(); // } //} protected override void OnDisable() { base.OnDisable(); if (rtObj != null) { rtObj.Enable(false); rtObj.Release(); rtObj = null; } }
protected override void OnHide() { base.OnHide(); if (m_RTObj != null) { m_RTObj.Release(); m_RTObj = null; } m_nindex = 0; ResetDes(); }
void SetRenderTexPos(IRenerTextureObj obj) { // SuitDataBase curData = m_suitDataManager.CurSuitDataBase; // if (curData != null) // { // obj.SetModelScale(curData.modelScale); // obj.SetCamera(new Vector3(0, 1f, 0f), new Vector3(0, 45, 0), curData.renderOffset); // } // if (curData != null) // { // m__modelTexture.transform.localPosition = new Vector3(curData.modeloffsetX, curData.modeloffsetY, 0); // } }
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 PropetyRelease() { if (m_RTObj != null) { m_RTObj.Release(); m_RTObj = null; } if (m_KnightRTObj != null) { m_KnightRTObj.Release(); m_KnightRTObj = null; } baseRideId = 0; }
/// <summary> /// 初始化 /// </summary> /// <param name="renderObj"></param> /// <param name="rotateY">起始旋转</param> /// <param name="size">UITexture size</param> /// touchcallback 触摸时回调 public void Initialize(IRenerTextureObj renderObj, float rotateY, Vector2 size, Action touchCallBack = null) { m_touchCallBack = touchCallBack; this.rotateY = rotateY; this.renderObj = renderObj; if (texture == null) { texture = CacheTransform.GetComponent <UITexture>(); } texture.width = (int)size.x; texture.height = (int)size.y; texture.mainTexture = this.renderObj.GetTexture(); ready = true; }
protected override void OnPanelBaseDestory() { base.OnPanelBaseDestory(); RegisterGlobalUIEvent(false); if (null != m_RTObj) { m_RTObj.Release(); m_RTObj = null; } if (null != m_petRTObj) { m_petRTObj.Release(); m_petRTObj = null; } //Engine.Utility.TimerAxis.Instance().KillTimer(TITLE_TIMERID, this); }
void InitModelPanel(uint ModelID) { //传入的数据全部都是在模型展示表格中的模型id ShowModelDataBase data = GameTableManager.Instance.GetTableItem <ShowModelDataBase>(ModelID); if (data == null) { return; } m_label_Name.text = data.ModelName; m_label_Des.text = data.ModelDescription; if (m_RTObj != null) { m_RTObj.Release(); } m_RTObj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj((int)ModelID, 800); if (m_RTObj == null) { return; } // 0 1.52 0 7 45 0 5 m_RTObj.SetCamera(new Vector3(0, data.quanOffsetY * 0.01f, 0), Vector3.zero, -data.quanDistance * 0.01f); //m_RTObj.SetCamera(new Vector3(0, 1.52f, 0), Vector3.zero, -4.89f); if (data.type == 1) { //eulerX = 0; m_label_BiaoTi.text = "珍兽详情"; } else { //eulerX = -90; m_label_BiaoTi.text = "神兵详情"; m_RTObj.AddLinkEffectWithoutEntity(10002); //CreateEffect(ModelID); } m_RTObj.SetModelRotateY(rotateY); //人物 if (m__Model != null) { m__Model.mainTexture = m_RTObj.GetTexture(); m__Model.MakePixelPerfect(); } }
protected override void OnHide() { base.OnHide(); m_nModelId = 0; if (m_RTObj_Ride != null) { m_RTObj_Ride.Release(); m_RTObj_Ride = null; } Release(); if (m_RTObj_Pet != null) { m_RTObj_Pet.Release(); m_RTObj_Pet = null; } }
private void CreatePlayerView() { if (null == m_RTObj) { m_RTObj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj(DataManager.Instance.MainPlayer, 750); if (null != m_RTObj) { m_RTObj.SetModelRotateY(-135); m_RTObj.SetCamera(new Vector3(0, 1f, 0f), new Vector3(0, 45, 0), 4f); m_RTObj.PlayModelAni(Client.EntityAction.Show); if (m_RTObj != null) { uint activeStoneSuitLv = DataManager.Manager <EquipManager>().ActiveStoneSuitLv; DataManager.Manager <EquipManager>().AddEquipStoneSuitParticle(m_RTObj, activeStoneSuitLv); } } } SetPlayerFightPower(); }
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)); } } }
public void SetModel(List <SuitData> suitData, int job, uint faceId) { int sex = 0; sex = (int)GameUtil.FaceToSex(faceId); rtGo.SetActive(true); if (suitData == null)//机器人无时装数据 { suitData = new List <SuitData>(); SuitData sd = new SuitData { baseid = 0, suit_type = EquipSuitType.Unknow_Type }; suitData.Add(sd); } if (rtObj != null) { rtObj.Release(); } rtObj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj(suitData, job, sex, 700); if (rtObj == null) { return; } UIRenderTexture rt = rtGo.GetComponent <UIRenderTexture>(); if (rt == null) { rt = rtGo.AddComponent <UIRenderTexture>(); } rtObj.SetModelRotateY(180); rtObj.SetModelScale(1f); rtObj.SetCamera(new Vector3(0, 1f, 0f), new Vector3(15, 0, 0), 4f); rt.SetDepth(3); rt.Initialize(rtObj, 180f, new UnityEngine.Vector2(600f, 600f)); rtObj.PlayModelAni(Client.EntityAction.Stand); }
void ShowPetRenderTex(bool bShow) { if (m_petRTObj == null) { // Engine.Utility.Log.Error("pet rt obj is null"); return; } if (m_petRTObj != null) { m_petRTObj.Enable(bShow); if (!bShow) { return; } } if (null != m__modelTexture) { 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 Vector2(750, 750), () => { DataManager.Manager <UIPanelManager>().HidePanel(PanelID.FashionTips); }); } SetRenderTexPos(m_petRTObj); } else { m_petRTObj.Release(); m_petRTObj = null; } }
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)); } } } }
void ShowRoleTexture(bool bPlayer, table.NpcDataBase npcDb = null) { if (m_RTObj != null) { m_RTObj.Release(); } if (bPlayer) { m_RTObj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj(MainPlayerHelper.GetMainPlayer(), 700); } else if (npcDb != null) { m_RTObj = DataManager.Manager <RenderTextureManager>().CreateRenderTextureObj((int)npcDb.dwViewModelSet, 700); } if (m_RTObj == null) { return; } if (bPlayer) { Client.IPlayer player = MainPlayerHelper.GetMainPlayer(); if (player == null) { return; } uint job = (uint)player.GetProp((int)Client.PlayerProp.Job); int sex = (int)player.GetProp((int)Client.PlayerProp.Sex); table.SelectRoleDataBase roleSelectData = GameTableManager.Instance.GetTableItem <table.SelectRoleDataBase>(job, sex); float offsety = 1.5f; float distance = 1.7f; float rotateX = 0f; if (roleSelectData != null) { offsety = roleSelectData.offsetY * 0.01f; distance = roleSelectData.distance * 0.01f; rotateX = roleSelectData.diaRotateX * 0.01f; } m_RTObj.SetCamera(new Vector3(0f, offsety, 0), new Vector3(rotateX, 0, 0), distance); //m_RTObj.SetCamera(new Vector3(0f, offsety, 0), Vector3.zero, distance); } else { float offsety = 1.0f; float distance = 1.7f; float rotateX = 0f; if (npcDb != null) { offsety = npcDb.diaOffsetY * 0.01f; distance = npcDb.diaDistance * 0.01f; rotateX = npcDb.diaRotateX * 0.01f; } m_RTObj.SetCamera(new Vector3(0f, offsety, 0), new Vector3(rotateX, 0, 0), distance); //m_RTObj.SetCamera(new Vector3(0f, offsety, 0), Vector3.zero, distance); } rotateY = 170f; //设置人物旋转 m_RTObj.SetModelRotateY(rotateY); m_RTObj.PlayModelAni(Client.EntityAction.Stand); //人物 if (m__NpcTexture != null) { m__NpcTexture.mainTexture = m_RTObj.GetTexture(); //m__NpcTexture.MakePixelPerfect(); } }