void UpdateCharActionSetFile() { m_pCharActionSetFile = null; if (m_pBusData != null) { int nCharModelID = m_pBusData.m_nModelID; DBC.COMMON_DBC <_DBC_CHARACTER_MODEL> s_pCharModelDBC = CDataBaseSystem.Instance.GetDataBase <_DBC_CHARACTER_MODEL>((int)DataBaseStruct.DBC_CHARACTER_MODEL); if (nCharModelID != MacroDefine.INVALID_ID) { _DBC_CHARACTER_MODEL pCharModel = s_pCharModelDBC.Search_Index_EQU(m_pBusData.m_nModelID); if (pCharModel != null) { string pszActionSetFileName = pCharModel.m_pszActionSetName_None; if (pszActionSetFileName.Length > 0) { m_pCharActionSetFile = CActionSetMgr.Instance.GetActionSetFile(pszActionSetFileName); } } } } }
public void AddActor(int ID, CMonsterInstanceInfo theMonsterInfo, Vector3 pos, Quaternion rot) { _DBC_CREATURE_ATT monsterAttr = mMonsterTable.Search_Index_EQU(ID); if (monsterAttr == null) { return; } _DBC_CHARACTER_MODEL CharModel = CDataBaseSystem.Instance.GetDataBase <_DBC_CHARACTER_MODEL>((int)DataBaseStruct.DBC_CHARACTER_MODEL).Search_Index_EQU(monsterAttr.nModelID); if (CharModel == null) { return; } GFX.GfxActor actor = (GFX.GfxActor)GFX.GFXObjectManager.Instance.createObject(CharModel.m_pszModelName, GFX.GFXObjectType.ACTOR); actor.position = pos; actor.rotation = rot; actor.setRenderInterfaceCreateEvt(new GFX.OnRenderInterfaceEvent(OnActorCreate)); CMonsterInstanceInfo monsterInfo = new CMonsterInstanceInfo(); CMonsterInstanceInfo.Copy(theMonsterInfo, monsterInfo); mAllActor.Add(actor, monsterInfo); }
void CreateRenderInterface() { if (m_pBusData != null && m_pBusData.m_nModelID != MacroDefine.INVALID_ID) { DBC.COMMON_DBC <_DBC_CHARACTER_MODEL> s_pCharModelDBC = CDataBaseSystem.Instance.GetDataBase <_DBC_CHARACTER_MODEL>((int)DataBaseStruct.DBC_CHARACTER_MODEL); string lpszModelFileName = null; _DBC_CHARACTER_MODEL pCharModel = s_pCharModelDBC.Search_Index_EQU(m_pBusData.m_nModelID); if (pCharModel != null) { lpszModelFileName = pCharModel.m_pszModelName; } if (lpszModelFileName != null) { mRenderInterface = GFX.GFXObjectManager.Instance.createObject(lpszModelFileName, GFX.GFXObjectType.ACTOR); mRenderInterface.useTempAsset();//资源未加载完全时使用临时模型 mRenderInterface.SetData(ID); //mRenderInterface.Actor_SetFile(lpszModelFileName); setVisible(isVisible()); mRenderInterface.SetRayQuery(false); mRenderInterface.SetAnimationEndEvent(new GFX.OnAnimationEvent(OnAnimationEnd)); UpdatePassengerAttached(); UpdateCharActionSetFile(); SetPosition(GetPosition()); SetFaceDir(GetFaceDir()); setVisible(isVisible()); } } }