private void LoadRenderObj(string strObj) { //人物资源预先加载 IRenderObj obj = null; IRenderSystem rs = RareEngine.Instance().GetRenderSystem(); rs.CreateRenderObj(ref strObj, ref obj, null, Vector3.zero, TaskPriority.TaskPriority_Immediate, true); if (obj != null) { rs.RemoveRenderObj(obj); } }
private void LoadRenderObj(string strObj, string strMaterial) { //人物资源预先加载 IRenderObj obj = null; IRenderSystem rs = RareEngine.Instance().GetRenderSystem(); rs.CreateRenderObj(ref strObj, ref obj, null, Vector3.zero, TaskPriority.TaskPriority_Normal, true); if (obj != null) { obj.ApplyMaterial(strMaterial); rs.RemoveRenderObj(obj); } }
void CreateRenderObjCallBackEvent(IRenderObj obj, object param) { // Engine.Utility.Log.Error("222>>>objID = " + obj.GetID() + " " + obj.GetName()); IRenderObj yuganObj = param as IRenderObj; if (yuganObj == null) { // Engine.Utility.Log.Error("--->>> param 为 null !!!"); return; } if (false == m_playerFishingDic.ContainsKey(m_fishingPlayerId)) { m_playerFishingDic.Add(m_fishingPlayerId, yuganObj); } // Engine.Utility.Log.Error("--->>> 成功更换武器:" + yuganObj.GetName()); }
/** * @brief 对象销毁 */ public void Destroy() { if (m_obj != null) { IRenderSystem rs = RareEngine.Instance().GetRenderSystem(); if (rs == null) { return; } if (m_obj.GetNode() == null) { return; } if (m_obj.GetNode().GetTransForm() == null) { return; } if (m_obj.GetNode().GetTransForm().parent != null) { m_obj.GetNode().GetTransForm().parent = null; } rs.RemoveRenderObj(m_obj); m_obj = null; for (int i = 0; i < m_lstSuitData.Count; ++i) { if (m_lstSuitData[i].obj != null) { rs.RemoveRenderObj(m_lstSuitData[i].obj); } } //Engine.Utility.Log.Error("Destroy Avater"); } }
//------------------------------------------------------------------------------------------------------- private void OnCreateBodyEvent(Engine.IRenderObj obj, object param) { if (obj == null) { return; } m_obj = obj; IRenderSystem rs = RareEngine.Instance().GetRenderSystem(); if (rs == null) { return; } //Engine.Utility.Log.Error("OnCreateBodyEvent {0}", m_obj.GetName()); for (int i = 0; i < m_lstSuitData.Count; ++i) { if (m_lstSuitData[i] == null) { continue; } if (m_lstSuitData[i].info.pos != SuitPos.Cloth) { //Engine.Utility.Log.Error("Create {0}", m_lstSuitData[i].info.pos.ToString()); rs.CreateRenderObj(ref m_lstSuitData[i].info.modelPath, ref m_lstSuitData[i].obj, OnCreateRenderObj, m_lstSuitData[i].info.pos, TaskPriority.TaskPriority_Normal, false); } } if (m_lstSuitData.Count == 1 && m_lstSuitData[0].info.pos == SuitPos.Cloth) { OnCreateRenderObj(obj, SuitPos.None); } m_obj.SetLayer(m_nLayer); }