Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс SEffectManager

Manager class for managing Effect (EffectParticle, EffectSound) Подробнее...

Защищенные статические члены

Generic playback

Methods for playing Effect

Заметки
Since 1.15, these should work on EffectSound as well
static int PlayInWorld (notnull Effect eff, vector pos)
 Play an Effect.
 
static int PlayOnObject (notnull Effect eff, Object obj, vector local_pos="0 0 0", vector local_ori="0 0 0", bool force_rotation_relative_to_world=false)
 Play an Effect.
 
static void Stop (int effect_id)
 Stops the Effect.
 
Create/Play sound

Methods for playing/creating sound

static EffectSound CreateSound (string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false, bool enviroment=false)
 Create an EffectSound.
 
static EffectSound PlaySound (string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
 Create and play an EffectSound.
 
static EffectSound PlaySoundParams (notnull SoundParams params, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
 Create and play an EffectSound.
 
static EffectSound PlaySoundCachedParams (string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
 Create and play an EffectSound, using or creating cached SoundParams.
 
static EffectSound PlaySoundEnviroment (string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
 Create and play an EffectSound, updating environment variables.
 
static EffectSound PlaySoundOnObject (string sound_set, Object parent_object, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
 Create and play an EffectSound.
 
Generic API

General methods used for SEffectManager

static void DestroyEffect (Effect effect)
 Unregisters, stops and frees the Effect.
 
static bool IsEffectExist (int effect_id)
 Checks whether an Effect ID is registered in SEffectManager.
 
static Effect GetEffectByID (int effect_id)
 Gets the Effect with the given registered Effect ID.
 
static int EffectRegister (Effect effect)
 Registers Effect in SEffectManager.
 
static void EffectUnregister (int id)
 Unregisters Effect in SEffectManager.
 
static void EffectUnregisterEx (Effect effect)
 Unregisters Effect in SEffectManager.
 
static int GetFreeEffectID ()
 Helper function for EffectRegister to decide an Effect ID.
 
Sound helpers

Sound specific helper methods

static bool DestroySound (EffectSound sound_effect)
 Legacy, backwards compatibility.
 
static SoundParams GetCachedSoundParam (string soundset)
 Get or create a cached SoundParams object.
 
Events

Various events that can be overriden for custom behaviour

static void Event_OnSoundWaveEnded (EffectSound effect_sound)
 Event called from EffectSound.Event_OnSoundWaveEnded.
 
static void Event_OnFrameUpdate (float time_delta)
 Event called on frame.
 
Lifetime

Creation and cleanup

static void Init ()
 Initialize the containers.
 
static void Cleanup ()
 Cleanup method to properly clean up the static data.
 

Статические защищенные данные

static ref map< int, ref Effectm_EffectsMap
 Static map of all registered effects <id, Effect>
 
static ref array< intm_FreeEffectIDs
 Static array of IDs that were previously used, but freed up by unregistering.
 
static int m_HighestFreeEffectID = 1
 Counter for quickly getting the next ID if FreeEffectIDs array is empty.
 
static const int INVALID_ID = 0
 As the counter starts at 1, Effect ID can never be 0.
 
static bool m_IsCleanup
 Bool to check whether Cleanup is happening, which means that the maps should no longer be accessed.
 
static bool m_IsInitialized
 Bool to check whether Init was called.
 
static ref map< string, ref SoundParamsm_ParamsMap
 Static map of cached sound params, to prevent having to recreate them.
 
static ref ScriptInvoker Event_OnFrameUpdate
 Static invoker for the SEffectManager.Event_OnFrameUpdate called form MissionGameplay.OnUpdate.
 

Подробное описание

Manager class for managing Effect (EffectParticle, EffectSound)

Предупреждения
Keeps a ref to any Effect registered (Created/Played), make sure to perform the necessary cleanup

Методы

◆ Cleanup()

static void Cleanup ( )
inlinestaticprotected

Cleanup method to properly clean up the static data.

Заметки
Will be called when MissionBase is destroyed
491 {
492 // Nothing to clean
493 if (!m_IsInitialized)
494 return;
495
496 m_IsCleanup = true;
497
498 // There should not be anything in here on server
499 if (GetGame() && GetGame().IsDedicatedServer())
500 {
501 if (m_ParamsMap.Count() > 0)
502 ErrorEx(string.Format("SEffectManager containing SoundParams on server."), ErrorExSeverity.WARNING);
503
504 if (m_EffectsMap.Count() > 0)
505 ErrorEx(string.Format("SEffectManager containing Effect on server."), ErrorExSeverity.WARNING);
506 }
507
508 // These are intentionally cached, just clear them
509 m_ParamsMap.Clear();
510
511 // These might not be intentionally still here, so log how many there are
512 #ifdef DEVELOPER
513 Print("--- SEffectManager Cleanup dump - Begin ------------------------");
514 Print(string.Format("Effect count: %1", m_EffectsMap.Count()));
515 #endif
516
517 // Best to call the unregister event before clearing the map
518 // In case some ref is still being held elsewhere and will still be kept alive
519 foreach (int id, Effect eff : m_EffectsMap)
520 {
521 eff.Event_OnUnregistered();
522 #ifdef SFXM_DUMP
523 Print(string.Format( "%1 :: %2 :: %3", eff, typename.EnumToString(EffectType, eff.GetEffectType()), eff.GetDebugName() ));
524 #endif
525 }
526
527 #ifdef DEVELOPER
528 Print("--- SEffectManager Cleanup dump - End --------------------------");
529 #endif
530
531 // Now we can clear it
532 m_EffectsMap.Clear();
533
534 // Reset the state
536 Event_OnFrameUpdate.Clear();
537 m_IsCleanup = false;
538 }
EffectType
Enum to determine what type of effect the Effect is.
Definition Effect.c:3
Definition EntityAI.c:95
static bool m_IsInitialized
Bool to check whether Init was called.
Definition EffectManager.c:18
static ref ScriptInvoker Event_OnFrameUpdate
Static invoker for the SEffectManager.Event_OnFrameUpdate called form MissionGameplay....
Definition EffectManager.c:24
static bool m_IsCleanup
Bool to check whether Cleanup is happening, which means that the maps should no longer be accessed.
Definition EffectManager.c:16
static ref map< string, ref SoundParams > m_ParamsMap
Static map of cached sound params, to prevent having to recreate them.
Definition EffectManager.c:21
static int m_HighestFreeEffectID
Counter for quickly getting the next ID if FreeEffectIDs array is empty.
Definition EffectManager.c:12
static ref map< int, ref Effect > m_EffectsMap
Static map of all registered effects <id, Effect>
Definition EffectManager.c:8
proto native CGame GetGame()
ErrorExSeverity
Definition EnDebug.c:62
proto void Print(void var)
Prints content of variable to console/log.
enum ShapeType ErrorEx

Перекрестные ссылки ErrorEx, Event_OnFrameUpdate, GetGame(), m_EffectsMap, m_HighestFreeEffectID, m_IsCleanup, m_IsInitialized, m_ParamsMap и Print().

Используется в MissionBaseWorld::MissionBase() и CGame::~CGame().

◆ CreateSound()

static EffectSound CreateSound ( string sound_set,
vector position,
float play_fade_in = 0,
float stop_fade_out = 0,
bool loop = false,
bool enviroment = false )
inlinestaticprotected

Create an EffectSound.

Предупреждения
Read PlayInWorld warning
Аргументы
sound_setstring The sound set name of the sound
positionvector The position to play the sound
play_fade_infloat The fade in duration of the sound (Optional)
stop_fade_outfloat The fade out duration of the sound (Optional)
loopbool Whether the sound should loop (Optional)
enviromentbool Whether to set environment variables (Optional)
Возвращает
EffectSound The created EffectSound
141 {
143 effect_sound.SetSoundSet(sound_set);
144 effect_sound.SetPosition(position);
145 effect_sound.SetSoundFadeIn(play_fade_in);
146 effect_sound.SetSoundFadeOut(stop_fade_out);
147 effect_sound.SetSoundLoop(loop);
148 effect_sound.SetEnviromentVariables(enviroment);
149
151
152 return effect_sound;
153 }
Wrapper class for managing sound through SEffectManager.
Definition EffectSound.c:5
static int EffectRegister(Effect effect)
Registers Effect in SEffectManager.
Definition EffectManager.c:318

Перекрестные ссылки EffectRegister().

Используется в HandleEngineSound(), FlashbangEffect::PlaySound(), PlaySound(), PlaySoundCachedParams(), PlaySoundEnviroment(), PlaySoundOnObject(), PlaySoundParams() и UpdateMusic().

◆ DestroyEffect()

◆ DestroySound()

static bool DestroySound ( EffectSound sound_effect)
inlinestaticprotected

Legacy, backwards compatibility.

Аргументы
sound_effectEffectSound The EffectSound to free
Возвращает
bool A bool which is always true
411 {
413 return true;
414 }
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
Definition EffectManager.c:267

Перекрестные ссылки DestroyEffect().

Используется в CleanSoundEffects(), CleanUpOnClosedClient() и Land_Underground_Stairs_Exit::CleanUpOnClosedClient().

◆ EffectRegister()

static int EffectRegister ( Effect effect)
inlinestaticprotected

Registers Effect in SEffectManager.

Заметки
Already handled in SEffectManager Create/Play methods
This will make SEffectManager hold a strong ref for the Effect
Аргументы
effectEffect The Effect to register
Возвращает
int The Effect ID
319 {
320 if (effect.IsRegistered())
321 {
322 ErrorEx(string.Format("Attempted to register Effect '%1' which was already registered.", effect.GetDebugName()), ErrorExSeverity.INFO);
323 return effect.GetID();
324 }
325
326 int id;
327
328 if (!m_IsCleanup)
329 {
330 id = GetFreeEffectID();
331 m_EffectsMap.Insert(id, effect);
332 effect.Event_OnRegistered(id);
333 }
334 else
335 ErrorEx("Attempted to register Effect while SEffectManager is cleaning up, request ignored.", ErrorExSeverity.WARNING);
336
337 return id;
338 }
static int GetFreeEffectID()
Helper function for EffectRegister to decide an Effect ID.
Definition EffectManager.c:378

Перекрестные ссылки ErrorEx, GetFreeEffectID(), m_EffectsMap и m_IsCleanup.

Используется в CreateSound(), PlayInWorld() и PlayOnObject().

◆ EffectUnregister()

static void EffectUnregister ( int id)
inlinestaticprotected

Unregisters Effect in SEffectManager.

Заметки
Will automatically occur on stop when the Effect is AutoDestroy
ID can be gotten from the Effect by calling Effect.GetID
Generic Play methods will also return the ID
Аргументы
idint The ID of the Effect to unregister
348 {
349 if (m_IsCleanup)
350 return; // No error needed, since it will have been unregistered anyways after cleanup is finished
351
352 Effect effect;
353 if ( m_EffectsMap.Find(id, effect) )
354 {
355 effect.Event_OnUnregistered();
356 m_EffectsMap.Remove(id);
357 }
358
359 if ( m_FreeEffectIDs.Find(id) == -1 )
360 {
361 m_FreeEffectIDs.Insert(id);
362 }
363 }
static ref array< int > m_FreeEffectIDs
Static array of IDs that were previously used, but freed up by unregistering.
Definition EffectManager.c:10

Перекрестные ссылки m_EffectsMap, m_FreeEffectIDs и m_IsCleanup.

Используется в EffectUnregisterEx() и ~Effect().

◆ EffectUnregisterEx()

static void EffectUnregisterEx ( Effect effect)
inlinestaticprotected

Unregisters Effect in SEffectManager.

Аргументы
effectEffect The Effect to unregister
370 {
371 EffectUnregister(effect.GetID());
372 }
static void EffectUnregister(int id)
Unregisters Effect in SEffectManager.
Definition EffectManager.c:347

Перекрестные ссылки EffectUnregister().

◆ Event_OnFrameUpdate()

static void Event_OnFrameUpdate ( float time_delta)
inlinestaticprotected

Event called on frame.

Заметки
Called from MissionGameplay.OnUpdate
Effects register themselves by Effect.SetEnableEventFrame(true)
EffectSound is automatically registered
Аргументы
time_deltafloat Time passed since the previous frame
459 {
461 }

Перекрестные ссылки Event_OnFrameUpdate.

◆ Event_OnSoundWaveEnded()

static void Event_OnSoundWaveEnded ( EffectSound effect_sound)
inlinestaticprotected

Event called from EffectSound.Event_OnSoundWaveEnded.

Заметки
Every registered sound is registered to call this
Аргументы
effect_soundEffectSound The EffectSound calling the event
447 {
448
449 }

Используется в EffectSound::Event_OnRegistered() и EffectSound::Event_OnUnregistered().

◆ GetCachedSoundParam()

static SoundParams GetCachedSoundParam ( string soundset)
inlinestaticprotected

Get or create a cached SoundParams object.

Аргументы
soundsetstring The sound set name of the sound
Возвращает
SoundParams The cached SoundParams for the given soundset
422 {
424 if (!m_ParamsMap.Find(soundset, params))
425 {
427 m_ParamsMap.Insert(soundset, params);
428 }
429 return params;
430 }
Definition Sound.c:101

Перекрестные ссылки m_ParamsMap.

Используется в PlaySoundCachedParams().

◆ GetEffectByID()

static Effect GetEffectByID ( int effect_id)
inlinestaticprotected

Gets the Effect with the given registered Effect ID.

Аргументы
effect_idint The Effect ID
Возвращает
Effect The Effect registered to the ID or null
304 {
305 if (!m_IsCleanup)
306 return m_EffectsMap[effect_id];
307 else
308 return null;
309 }

Перекрестные ссылки m_EffectsMap и m_IsCleanup.

◆ GetFreeEffectID()

static int GetFreeEffectID ( )
inlinestaticprotected

Helper function for EffectRegister to decide an Effect ID.

Возвращает
int A currently unused Effect ID
379 {
380 int return_id;
381
382 if (m_FreeEffectIDs.Count() > 0)
383 {
384 return_id = m_FreeEffectIDs.Get(0);
385 m_FreeEffectIDs.Remove(0);
386 }
387 else
388 {
391 }
392
393 return return_id;
394 }

Перекрестные ссылки m_FreeEffectIDs и m_HighestFreeEffectID.

Используется в EffectRegister().

◆ Init()

static void Init ( )
inlinestaticprotected

Initialize the containers.

Заметки
This is done this way, to have these not exist on server
477 {
482
483 m_IsInitialized = true;
484 }
ScriptInvoker Class provide list of callbacks usage:
Definition tools.c:116

Перекрестные ссылки Event_OnFrameUpdate, m_EffectsMap, m_FreeEffectIDs, m_IsInitialized и m_ParamsMap.

Используется в CGame::CGame().

◆ IsEffectExist()

static bool IsEffectExist ( int effect_id)
inlinestaticprotected

Checks whether an Effect ID is registered in SEffectManager.

Аргументы
effect_idint The Effect ID to check
Возвращает
bool Whether there is an Effect registered for this ID
291 {
292 if (!m_IsCleanup)
293 return m_EffectsMap[effect_id] != null;
294 else
295 return false;
296 }

Перекрестные ссылки m_EffectsMap и m_IsCleanup.

Используется в CreateCarDestroyedEffect(), EOnPostSimulate() и ManBase::SetDecayEffects().

◆ PlayInWorld()

static int PlayInWorld ( notnull Effect eff,
vector pos )
inlinestaticprotected

Play an Effect.

Предупреждения
As the Effect is automatically registered, it will not be freed automatically (because of the ref) Unless 'SetAutodestroy(true)' is called on the created 'Effect', which will clean it up when the sound stop Alternatively, SEffectManager.DestroyEffect can be called manually, which will also unregister and cleanup
Аргументы
effEffect The Effect to play
posvector The position to play the Effect
Возвращает
int The registered ID of the Effect
44 {
45 // Stop the effect first, just in case
46 eff.Stop();
47
48 int id = EffectRegister(eff);
49
50 eff.SetPosition( pos );
51 eff.Start();
52
53 return id;
54 }

Перекрестные ссылки EffectRegister().

Используется в Hit_MeatBones::BloodSplatGround(), CreateParticle(), ImpactMaterials::EvaluateImpactEffect(), ManBase::OnParticleEvent(), AmmoEffects::PlayAmmoEffect(), BleedingSourcesManagerBase::SetDiag(), DayZIntroSceneXbox::SetupParticles() и Explosion::SpawnEffect().

◆ PlayOnObject()

static int PlayOnObject ( notnull Effect eff,
Object obj,
vector local_pos = "0 0 0",
vector local_ori = "0 0 0",
bool force_rotation_relative_to_world = false )
inlinestaticprotected

Play an Effect.

Предупреждения
Read PlayInWorld warning
Аргументы
effEffect The Effect to play
objObject The parent of the Effect
local_posvector The local position to play the Effect in relation to the parent (Optional)
local_orivector The local orientation to play the Effect in relation to the parent (Optional)
force_rotation_relative_to_worldbool Whether to force the orientation to stay in WS (Optional)
Возвращает
int The registered ID of the Effect
67 {
68 // Stop the effect first, just in case
69 eff.Stop();
70
71 int id = EffectRegister(eff);
72
73 if (!obj)
74 {
75 ErrorEx("Parent object is null.", ErrorExSeverity.WARNING);
76 eff.SetPosition(local_pos);
77 }
78 else
79 {
80 eff.SetPosition(obj.GetPosition());
81 }
82
83 eff.SetParent(obj);
84 eff.SetLocalPosition(local_pos);
85 eff.SetAttachedLocalOri(local_ori);
86
88 {
90
91 if (eff_particle)
92 {
93 eff_particle.ForceParticleRotationRelativeToWorld(force_rotation_relative_to_world);
94 }
95 }
96
97 eff.Start();
98
99 return id;
100 }
Wrapper class for managing particles through SEffectManager.
Definition EffectParticle.c:5

Перекрестные ссылки EffectRegister() и ErrorEx.

Используется в CreateCarDestroyedEffect(), EOnPostSimulate(), ManBase::SetDecayEffects() и ItemBase::StartLoopSound().

◆ PlaySound()

static EffectSound PlaySound ( string sound_set,
vector position,
float play_fade_in = 0,
float stop_fade_out = 0,
bool loop = false )
inlinestaticprotected

Create and play an EffectSound.

Предупреждения
Calls CreateSound, read CreateSound warning
Аргументы
sound_setstring The sound set name of the sound
positionvector The position to play the sound
play_fade_infloat The fade in duration of the sound (Optional)
stop_fade_outfloat The fade out duration of the sound (Optional)
loopbool Whether the sound should loop (Optional)
Возвращает
EffectSound The created EffectSound
166 {
168
169 effect_sound.SoundPlay();
170
171 return effect_sound;
172 }
static EffectSound CreateSound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false, bool enviroment=false)
Create an EffectSound.
Definition EffectManager.c:140

Перекрестные ссылки CreateSound().

Используется в CGame::DelayedMidAirDetonation(), House::EEInit(), ItemBase::EEItemAttached(), ItemBase::EEItemDetached(), HandleDoorsSound(), HandleEngineSound(), HandleSeatAdjustmentSound(), CarScript::OnAnimationPhaseStarted(), Weapon::OnFireModeChange(), InventoryItem::OnRPC(), CGame::OnRPC(), OnSteppedOn(), InventoryItemSuper::OnWasAttached(), InventoryItemSuper::OnWasDetached(), SpookyEventBase::Perform(), ActionBuildShelter::PlayActionFinishSound(), ActionBuildShelter::PlayActionLoopSound(), ActionBuildShelter::PlayActionStartSound(), InventoryItem::PlayAttachSound(), InventoryItem::PlayDeployFinishSound(), ItemBase::PlayDeployLoopSound(), Inventory_Base::PlayDeployLoopSound(), InventoryItem::PlayDeployLoopSoundEx(), InventoryItem::PlayDeploySound(), PlayDisarmingLoopSound(), InventoryItem::PlayPlaceSound(), PlayRepackingLoopSound(), Backpack_Base::PlayRepackingLoopSound(), PlaySoundActivate(), TrapBase::PlaySoundBiteEmpty(), TrapBase::PlaySoundBiteLeg(), TrapBase::PlaySoundOpen(), Barrel_ColorBase::SoundBarrelClosePlay(), FireplaceBase::SoundBarrelClosePlay(), Barrel_ColorBase::SoundBarrelOpenPlay(), FireplaceBase::SoundBarrelOpenPlay(), Edible_Base::SoundCookingStart(), Entity::SoundHardBushFallingPlay(), Entity::SoundHardTreeFallingPlay(), Entity::SoundSoftBushFallingPlay(), Entity::SoundSoftTreeFallingPlay(), ItemBase::SoundTentClosePlay(), ItemBase::SoundTentCloseWindowPlay(), ItemBase::SoundTentOpenPlay(), ItemBase::SoundTentOpenWindowPlay() и StartActivate().

◆ PlaySoundCachedParams()

static EffectSound PlaySoundCachedParams ( string sound_set,
vector position,
float play_fade_in = 0,
float stop_fade_out = 0,
bool loop = false )
inlinestaticprotected

Create and play an EffectSound, using or creating cached SoundParams.

Предупреждения
Calls CreateSound, read CreateSound warning
Аргументы
sound_setstring The sound set name of the sound
positionvector The position to play the sound
play_fade_infloat The fade in duration of the sound (Optional)
stop_fade_outfloat The fade out duration of the sound (Optional)
loopbool Whether the sound should loop (Optional)
Возвращает
EffectSound The created EffectSound
204 {
206
208
209 effect_sound.SoundPlayEx(params);
210
211 return effect_sound;
212 }
static SoundParams GetCachedSoundParam(string soundset)
Get or create a cached SoundParams object.
Definition EffectManager.c:421

Перекрестные ссылки CreateSound() и GetCachedSoundParam().

Используется в PlaySoundEx().

◆ PlaySoundEnviroment()

static EffectSound PlaySoundEnviroment ( string sound_set,
vector position,
float play_fade_in = 0,
float stop_fade_out = 0,
bool loop = false )
inlinestaticprotected

Create and play an EffectSound, updating environment variables.

Предупреждения
Calls CreateSound, read CreateSound warning
Аргументы
sound_setstring The sound set name of the sound
positionvector The position to play the sound
play_fade_infloat The fade in duration of the sound (Optional)
stop_fade_outfloat The fade out duration of the sound (Optional)
loopbool Whether the sound should loop (Optional)
Возвращает
EffectSound The created EffectSound
225 {
227
228 effect_sound.SoundPlay();
229
230 return effect_sound;
231 }

Перекрестные ссылки CreateSound().

Используется в ScriptConsoleSoundsTab::HandleKeys(), ScriptConsoleSoundsTab::OnClick() и IEntity::PlaySoundSetAtMemoryPoint().

◆ PlaySoundOnObject()

static EffectSound PlaySoundOnObject ( string sound_set,
Object parent_object,
float play_fade_in = 0,
float stop_fade_out = 0,
bool loop = false )
inlinestaticprotected

Create and play an EffectSound.

Предупреждения
Calls CreateSound, read CreateSound warning
Аргументы
sound_setstring The sound set name of the sound
parent_objectObject The parent Object for the sound to follow
play_fade_infloat The fade in duration of the sound (Optional)
stop_fade_outfloat The fade out duration of the sound (Optional)
loopbool Whether the sound should loop (Optional)
Возвращает
EffectSound The created EffectSound
244 {
246
247 effect_sound.SetParent( parent_object );
248 effect_sound.SetLocalPosition( vector.Zero );
249 effect_sound.SoundPlay();
250
251 return effect_sound;
252 }
Definition EnConvert.c:106
static const vector Zero
Definition EnConvert.c:110

Перекрестные ссылки CreateSound() и vector::Zero.

Используется в ItemBase::DischargeClient(), ManBase::EEHitByRemote(), ManBase::OnBleedingSourceAdded(), ItemBase::OnIsCharged(), ManBase::OnPlayerRecievedHit(), ItemBase::OnWorkStart(), PlayEmptyingLoopSound(), PlayPouringLoopSound(), PlaySound(), IEntity::PlaySoundSet() и StopEmptyingLoopSound().

◆ PlaySoundParams()

static EffectSound PlaySoundParams ( notnull SoundParams params,
vector position,
float play_fade_in = 0,
float stop_fade_out = 0,
bool loop = false )
inlinestaticprotected

Create and play an EffectSound.

Предупреждения
Calls CreateSound, read CreateSound warning
Аргументы
paramsSoundParams Params to create the sound with
positionvector The position to play the sound
play_fade_infloat The fade in duration of the sound (Optional)
stop_fade_outfloat The fade out duration of the sound (Optional)
loopbool Whether the sound should loop (Optional)
Возвращает
EffectSound The created EffectSound
185 {
187
188 effect_sound.SoundPlayEx(params);
189
190 return effect_sound;
191 }

Перекрестные ссылки CreateSound().

◆ Stop()

static void Stop ( int effect_id)
inlinestaticprotected

Stops the Effect.

Аргументы
effect_idint The ID of the Effect to Stop
107 {
108 Effect eff = m_EffectsMap.Get(effect_id);
109
110 if (eff)
111 {
112 eff.Stop();
113 }
114 else
115 {
116 ErrorEx(string.Format("Failed to stop Effect with ID %1. The ID is not registered in m_EffectsMap!", effect_id));
117 }
118 }

Перекрестные ссылки ErrorEx и m_EffectsMap.

Используется в EOnPostSimulate().

Поля

◆ Event_OnFrameUpdate

ref ScriptInvoker Event_OnFrameUpdate
staticprotected

Static invoker for the SEffectManager.Event_OnFrameUpdate called form MissionGameplay.OnUpdate.

Используется в Cleanup(), Event_OnFrameUpdate(), Init(), MissionBase::OnUpdate() и SetEnableEventFrame().

◆ INVALID_ID

const int INVALID_ID = 0
staticprotected

As the counter starts at 1, Effect ID can never be 0.

Используется в Event_OnUnregistered().

◆ m_EffectsMap

ref map<int, ref Effect> m_EffectsMap
staticprotected

Static map of all registered effects <id, Effect>

Используется в Cleanup(), EffectRegister(), EffectUnregister(), GetEffectByID(), Init(), IsEffectExist() и Stop().

◆ m_FreeEffectIDs

ref array<int> m_FreeEffectIDs
staticprotected

Static array of IDs that were previously used, but freed up by unregistering.

Используется в EffectUnregister(), GetFreeEffectID() и Init().

◆ m_HighestFreeEffectID

int m_HighestFreeEffectID = 1
staticprotected

Counter for quickly getting the next ID if FreeEffectIDs array is empty.

Используется в Cleanup() и GetFreeEffectID().

◆ m_IsCleanup

bool m_IsCleanup
staticprotected

Bool to check whether Cleanup is happening, which means that the maps should no longer be accessed.

Используется в Cleanup(), EffectRegister(), EffectUnregister(), GetEffectByID() и IsEffectExist().

◆ m_IsInitialized

bool m_IsInitialized
staticprotected

Bool to check whether Init was called.

Используется в Cleanup() и Init().

◆ m_ParamsMap

ref map<string, ref SoundParams> m_ParamsMap
staticprotected

Static map of cached sound params, to prevent having to recreate them.

Используется в Cleanup(), GetCachedSoundParam() и Init().


Объявления и описания членов класса находятся в файле: