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(); } } }
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(); } }
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(); } }