public void UpdateBuffEffect() { if (m_Character.GetRenderInterface() != null) { foreach (KeyValuePair <uint, SImpactEffect> subItem in m_mapImpactEffect) { uint uImpactID = subItem.Key; SImpactEffect pImpactEffect = subItem.Value; _DBC_BUFF_IMPACT pBuffImpact = CDataBaseSystem.Instance.GetDataBase <_DBC_BUFF_IMPACT>((int)DataBaseStruct.DBC_BUFF_IMPACT).Search_Index_EQU((int)uImpactID); object objTemp = (object)pBuffImpact; if (objTemp == null) { continue; } if (pBuffImpact.m_lpszEffect_Continuous.Length > 0 && m_Character.GetRenderInterface() != null) { uint uEffect = m_Character.GetRenderInterface().AddEffect(pBuffImpact.m_lpszEffect_Continuous, pBuffImpact.m_lpszBind_Continuous); pImpactEffect.SetEffect(uEffect); } } } }
////public Dictionary<uint, SImpactEffect> GetImpactEffectMap() ////{ //// return m_mapImpactEffect; ////} private bool InsertImpact(uint idImpact, uint uCreatorID, bool bShowEnableEffect) { SImpactEffect pImpactEffect; if (!m_mapImpactEffect.ContainsKey(idImpact)) { pImpactEffect = new SImpactEffect(); pImpactEffect.SetImpactID(idImpact); pImpactEffect.SetCreatorID(uCreatorID); m_mapImpactEffect[idImpact] = pImpactEffect; _DBC_BUFF_IMPACT pBuffImpact = CDataBaseSystem.Instance.GetDataBase <_DBC_BUFF_IMPACT>((int)DataBaseStruct.DBC_BUFF_IMPACT).Search_Index_EQU((int)idImpact); object objTemp = (object)pBuffImpact; if (objTemp != null) { bool bLineEffect = pBuffImpact.m_bLineEffect; string strCreatorLocator = pBuffImpact.m_pszCreatorLocator; pImpactEffect.SetLineEffect(bLineEffect); pImpactEffect.SetCreatorLocator(strCreatorLocator); if (bShowEnableEffect) { // 效果触发的特效(RenderInterface自动会删除) if (pBuffImpact.m_lpszEffect_Active.Length > 0 && m_Character.GetRenderInterface() != null) { m_Character.GetRenderInterface().AddEffect(pBuffImpact.m_lpszEffect_Active, pBuffImpact.m_lpszBind_Active); } if (pBuffImpact.m_lpszSound_Active.Length > 0) { //Vector3 fvPos = m_Character.getPosition(); ////sunyu此接口是提供给fairy调用的音效接口,所以传入坐标必须是gfx坐标 //Vector3 fvGame; //if (!GameProcedure.s_pGfxSystem.Axis_Trans(CRenderSystem.AX_GAME, fvPos, // CRenderSystem.AX_GFX, fvGame)) //{ // return false; //} //CSoundSystemFMod._PlaySoundFunc(pBuffImpact.m_lpszSound_Active, &fvGame.x, false); } } //需要我们控制的特效 if (pBuffImpact.m_lpszBind_Continuous.Length > 0 && pBuffImpact.m_lpszEffect_Continuous.Length > 0 && m_Character.GetRenderInterface() != null) { uint uEffect = m_Character.GetRenderInterface().AddEffect(pBuffImpact.m_lpszEffect_Continuous, pBuffImpact.m_lpszBind_Continuous); pImpactEffect.SetEffect(uEffect); UpdateEffectTargetPos(pImpactEffect); } } } else { pImpactEffect = m_mapImpactEffect[idImpact]; } pImpactEffect.AddRefCount(); //更新宠物Frame //UpdatePetFrame(); return(true); }