コード例 #1
0
 // Token: 0x06000560 RID: 1376 RVA: 0x00015DB0 File Offset: 0x00013FB0
 private static void HandleEffectClientInternal(NetworkMessage netMsg)
 {
     netMsg.ReadMessage <EffectManager.EffectMessage>(EffectManager.incomingEffectMessage);
     if (EffectCatalog.GetEffectDef(EffectManager.incomingEffectMessage.effectIndex) == null)
     {
         return;
     }
     EffectManager.SpawnEffect(EffectManager.incomingEffectMessage.effectIndex, EffectManager.incomingEffectMessage.effectData, false);
 }
コード例 #2
0
 // Token: 0x0600055E RID: 1374 RVA: 0x00015BF4 File Offset: 0x00013DF4
 public static void SpawnEffect(EffectIndex effectIndex, EffectData effectData, bool transmit)
 {
     if (transmit)
     {
         EffectManager.TransmitEffect(effectIndex, effectData, null);
         if (NetworkServer.active)
         {
             return;
         }
     }
     if (NetworkClient.active)
     {
         if (effectData.networkSoundEventIndex != NetworkSoundEventIndex.Invalid)
         {
             PointSoundManager.EmitSoundLocal(NetworkSoundEventCatalog.GetAkIdFromNetworkSoundEventIndex(effectData.networkSoundEventIndex), effectData.origin);
         }
         EffectDef effectDef = EffectCatalog.GetEffectDef(effectIndex);
         if (effectDef == null)
         {
             return;
         }
         string spawnSoundEventName = effectDef.spawnSoundEventName;
         if (!string.IsNullOrEmpty(spawnSoundEventName))
         {
             PointSoundManager.EmitSoundLocal((AkEventIdArg)spawnSoundEventName, effectData.origin);
         }
         SurfaceDef surfaceDef = SurfaceDefCatalog.GetSurfaceDef(effectData.surfaceDefIndex);
         if (surfaceDef != null)
         {
             string impactSoundString = surfaceDef.impactSoundString;
             if (!string.IsNullOrEmpty(impactSoundString))
             {
                 PointSoundManager.EmitSoundLocal((AkEventIdArg)impactSoundString, effectData.origin);
             }
         }
         if (!VFXBudget.CanAffordSpawn(effectDef.prefabVfxAttributes))
         {
             return;
         }
         if (effectDef.cullMethod != null && !effectDef.cullMethod(effectData))
         {
             return;
         }
         EffectData      effectData2 = effectData.Clone();
         EffectComponent component   = UnityEngine.Object.Instantiate <GameObject>(effectDef.prefab, effectData2.origin, effectData2.rotation).GetComponent <EffectComponent>();
         if (component)
         {
             component.effectData = effectData2.Clone();
         }
     }
 }
コード例 #3
0
 public static void Init()
 {
     EffectCatalog.SetEntries(EffectCatalog.GetDefaultEffectDefs());
 }
コード例 #4
0
 // Token: 0x0600055D RID: 1373 RVA: 0x00015BE3 File Offset: 0x00013DE3
 public static void SpawnEffect(GameObject effectPrefab, EffectData effectData, bool transmit)
 {
     EffectManager.SpawnEffect(EffectCatalog.FindEffectIndexFromPrefab(effectPrefab), effectData, transmit);
 }