DayZ 1.26
DayZ 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 int GetFreeEffecterID ()
 
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 InitServer ()
 
static void Cleanup ()
 Cleanup method to properly clean up the static data.
 
static int CreateParticleServer (vector pos, EffecterParameters parameters)
 returns unique effecter ID
 
static void ReinitParticleServer (int effecterID, EffecterParameters parameters)
 allows re-initializing existing effecter with new parameters (extept m_EffecterType, obviously)
 
static void ReactivateParticleServer (int effecterID)
 
static void StartParticleServer (int effecterID)
 
static void StopParticleServer (int effecterID)
 
static void DestroyEffecterParticleServer (int effecterID)
 
static void OnUpdate (float timeslice)
 

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

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.
 
static ref map< int, EffecterBasem_EffectersMap
 
static ref array< intm_FreeEffecterIDs
 Static array of IDs that were previously used, but freed up by unregistering Effecters.
 
static int m_HighestFreeEffecterID = 1
 

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

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
519 {
520 // Nothing to clean
521 if (!m_IsInitialized)
522 return;
523
524 m_IsCleanup = true;
525
526 // There should not be anything in here on server
527 if (GetGame() && GetGame().IsDedicatedServer())
528 {
529 if (m_ParamsMap.Count() > 0)
530 ErrorEx(string.Format("SEffectManager containing SoundParams on server."), ErrorExSeverity.WARNING);
531
532 if (m_EffectsMap.Count() > 0)
533 ErrorEx(string.Format("SEffectManager containing Effect on server."), ErrorExSeverity.WARNING);
534 }
535
536 // These are intentionally cached, just clear them
537 m_ParamsMap.Clear();
538
539 // These might not be intentionally still here, so log how many there are
540 #ifdef DEVELOPER
541 Print("--- SEffectManager Cleanup dump - Begin ------------------------");
542 Print(string.Format("Effect count: %1", m_EffectsMap.Count()));
543 #endif
544
545 // Best to call the unregister event before clearing the map
546 // In case some ref is still being held elsewhere and will still be kept alive
547 foreach (int id, Effect eff : m_EffectsMap)
548 {
549 eff.Event_OnUnregistered();
550 #ifdef SFXM_DUMP
551 Print(string.Format( "%1 :: %2 :: %3", eff, typename.EnumToString(EffectType, eff.GetEffectType()), eff.GetDebugName() ));
552 #endif
553 }
554
555 foreach (int i, EffecterBase effecter : m_EffectersMap)
556 {
557 effecter.Delete();
558 }
559
560 #ifdef DEVELOPER
561 Print("--- SEffectManager Cleanup dump - End --------------------------");
562 #endif
563
564 // Now we can clear it
565 m_EffectsMap.Clear();
566 m_EffectersMap.Clear();
567
568 // Reset the state
570 Event_OnFrameUpdate.Clear();
571 m_IsCleanup = false;
572 }
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, EffecterBase > m_EffectersMap
Definition EffectManager.c:26
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_EffectersMap, m_EffectsMap, m_HighestFreeEffectID, m_IsCleanup, m_IsInitialized, m_ParamsMap и Print().

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

◆ CreateParticleServer()

static int CreateParticleServer ( vector pos,
EffecterParameters parameters )
inlinestaticprotected

returns unique effecter ID

578 {
579 EffecterBase eff;
580 eff = EffecterBase.Cast(GetGame().CreateObjectEx(parameters.m_EffecterType, pos, ECE_PLACE_ON_SURFACE));
581
582 if (eff)
583 {
584 int id = GetFreeEffecterID();
585 m_EffectersMap.Insert(id, eff);
586 }
587
588 eff.Init(id, parameters);
589 return id;
590 }
const int ECE_PLACE_ON_SURFACE
Definition CentralEconomy.c:37
static int GetFreeEffecterID()
Definition EffectManager.c:344

Перекрестные ссылки ECE_PLACE_ON_SURFACE, GetFreeEffecterID(), GetGame() и m_EffectersMap.

Используется в ItemBase::PlayCatchParticleSynced() и ActionFishingNew::PlaySplashEffectSynced().

◆ 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
145 {
147 effect_sound.SetSoundSet(sound_set);
148 effect_sound.SetPosition(position);
149 effect_sound.SetSoundFadeIn(play_fade_in);
150 effect_sound.SetSoundFadeOut(stop_fade_out);
151 effect_sound.SetSoundLoop(loop);
152 effect_sound.SetEnviromentVariables(enviroment);
153
155
156 return effect_sound;
157 }
Wrapper class for managing sound through SEffectManager.
Definition EffectSound.c:5
static int EffectRegister(Effect effect)
Registers Effect in SEffectManager.
Definition EffectManager.c:322

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

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

◆ DestroyEffect()

◆ DestroyEffecterParticleServer()

static void DestroyEffecterParticleServer ( int effecterID)
inlinestaticprotected
631 {
632 EffecterBase eff = m_EffectersMap.Get(effecterID);
633 if (eff)
634 {
636 eff.DeleteSafe();
637 }
638 }

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

Используется в DecreaseLifespan(), ActionFishingNewCB::DestroySplashEffectSynced(), OnEndServer() и ItemBase::SetActive().

◆ DestroySound()

static bool DestroySound ( EffectSound sound_effect)
inlinestaticprotected

Legacy, backwards compatibility.

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

Перекрестные ссылки 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
323 {
324 if (effect.IsRegistered())
325 {
326 ErrorEx(string.Format("Attempted to register Effect '%1' which was already registered.", effect.GetDebugName()), ErrorExSeverity.INFO);
327 return effect.GetID();
328 }
329
330 int id;
331
332 if (!m_IsCleanup)
333 {
334 id = GetFreeEffectID();
335 m_EffectsMap.Insert(id, effect);
336 effect.Event_OnRegistered(id);
337 }
338 else
339 ErrorEx("Attempted to register Effect while SEffectManager is cleaning up, request ignored.", ErrorExSeverity.WARNING);
340
341 return id;
342 }
static int GetFreeEffectID()
Helper function for EffectRegister to decide an Effect ID.
Definition EffectManager.c:400

Перекрестные ссылки 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
370 {
371 if (m_IsCleanup)
372 return; // No error needed, since it will have been unregistered anyways after cleanup is finished
373
374 Effect effect;
375 if ( m_EffectsMap.Find(id, effect) )
376 {
377 effect.Event_OnUnregistered();
378 m_EffectsMap.Remove(id);
379 }
380
381 if ( m_FreeEffectIDs.Find(id) == -1 )
382 {
383 m_FreeEffectIDs.Insert(id);
384 }
385 }
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
392 {
393 EffectUnregister(effect.GetID());
394 }
static void EffectUnregister(int id)
Unregisters Effect in SEffectManager.
Definition EffectManager.c:369

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

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

◆ 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
481 {
483 }

Перекрестные ссылки 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
469 {
470
471 }

Используется в 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
444 {
446 if (!m_ParamsMap.Find(soundset, params))
447 {
449 m_ParamsMap.Insert(soundset, params);
450 }
451 return params;
452 }
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
308 {
309 if (!m_IsCleanup)
310 return m_EffectsMap[effect_id];
311 else
312 return null;
313 }

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

◆ GetFreeEffecterID()

static int GetFreeEffecterID ( )
inlinestaticprotected
345 {
346 int return_id;
347
348 if (m_FreeEffecterIDs.Count() > 0)
349 {
351 m_FreeEffecterIDs.Remove(0);
352 }
353 else
354 {
357 }
358
359 return return_id;
360 }
static int m_HighestFreeEffecterID
Definition EffectManager.c:30
static ref array< int > m_FreeEffecterIDs
Static array of IDs that were previously used, but freed up by unregistering Effecters.
Definition EffectManager.c:28

Перекрестные ссылки m_FreeEffecterIDs и m_HighestFreeEffecterID.

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

◆ GetFreeEffectID()

static int GetFreeEffectID ( )
inlinestaticprotected

Helper function for EffectRegister to decide an Effect ID.

Возвращает
int A currently unused Effect ID
401 {
402 int return_id;
403
404 if (m_FreeEffectIDs.Count() > 0)
405 {
406 return_id = m_FreeEffectIDs.Get(0);
407 m_FreeEffectIDs.Remove(0);
408 }
409 else
410 {
413 }
414
415 return return_id;
416 }

Перекрестные ссылки 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
499 {
504
505 m_IsInitialized = true;
506 }
ScriptInvoker Class provide list of callbacks usage:
Definition tools.c:116

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

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

◆ InitServer()

static void InitServer ( )
inlinestaticprotected

Перекрестные ссылки m_EffectersMap и m_FreeEffecterIDs.

Используется в 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
295 {
296 if (!m_IsCleanup)
297 return m_EffectsMap[effect_id] != null;
298 else
299 return false;
300 }

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

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

◆ OnUpdate()

static void OnUpdate ( float timeslice)
inlinestaticprotected
641 {
642 if (m_EffectersMap)
643 {
644 foreach (int i, EffecterBase effecter : m_EffectersMap)
645 {
646 effecter.DecreaseLifespan(timeslice);
647 }
648 }
649 }

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

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

◆ 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
48 {
49 // Stop the effect first, just in case
50 eff.Stop();
51
52 int id = EffectRegister(eff);
53
54 eff.SetPosition( pos );
55 eff.Start();
56
57 return id;
58 }

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

Используется в Hit_MeatBones::BloodSplatGround(), CreateParticle(), ImpactMaterials::EvaluateImpactEffect(), ManBase::OnParticleEvent(), ParticleEffecter::OnVariablesSynchronized(), OnVariablesSynchronized(), 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
71 {
72 // Stop the effect first, just in case
73 eff.Stop();
74
75 int id = EffectRegister(eff);
76
77 if (!obj)
78 {
79 ErrorEx("Parent object is null.", ErrorExSeverity.WARNING);
80 eff.SetPosition(local_pos);
81 }
82 else
83 {
84 eff.SetPosition(obj.GetPosition());
85 }
86
87 eff.SetParent(obj);
88 eff.SetLocalPosition(local_pos);
89 eff.SetAttachedLocalOri(local_ori);
90
92 {
94
95 if (eff_particle)
96 {
97 eff_particle.ForceParticleRotationRelativeToWorld(force_rotation_relative_to_world);
98 }
99 }
100
101 eff.Start();
102
103 return id;
104 }
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
170 {
172
173 effect_sound.SoundPlay();
174
175 return effect_sound;
176 }
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:144

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

Используется в CGame::DelayedMidAirDetonation(), House::EEInit(), ItemBase::EEItemAttached(), ItemBase::EEItemDetached(), HandleDoorsSound(), HandleEngineSound(), BoatScript::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(), 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() и GeyserTrigger::UpdateGeyserState().

◆ 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
208 {
210
212
213 effect_sound.SoundPlayEx(params);
214
215 return effect_sound;
216 }
static SoundParams GetCachedSoundParam(string soundset)
Get or create a cached SoundParams object.
Definition EffectManager.c:443

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

Используется в Land_WarheadStorage_PowerStation::OnVariablesSynchronized(), BoatScript::PlaySound() и 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
229 {
231
232 effect_sound.SoundPlay();
233
234 return effect_sound;
235 }

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

Используется в ScriptConsoleSoundsTab::HandleKeys(), ScriptConsoleSoundsTab::OnClick(), ItemBase::PlayCatchSound() и 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
248 {
250
251 effect_sound.SetParent( parent_object );
252 effect_sound.SetLocalPosition( vector.Zero );
253 effect_sound.SoundPlay();
254
255 return effect_sound;
256 }
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
189 {
191
192 effect_sound.SoundPlayEx(params);
193
194 return effect_sound;
195 }

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

◆ ReactivateParticleServer()

static void ReactivateParticleServer ( int effecterID)
inlinestaticprotected
603 {
604 EffecterBase eff = m_EffectersMap.Get(effecterID);
605 if (eff)
606 {
607 eff.Reactivate();
608 }
609 }

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

Используется в ItemBase::PlayCatchParticleSynced() и ActionFishingNew::PlaySplashEffectSynced().

◆ ReinitParticleServer()

static void ReinitParticleServer ( int effecterID,
EffecterParameters parameters )
inlinestaticprotected

allows re-initializing existing effecter with new parameters (extept m_EffecterType, obviously)

594 {
595 EffecterBase eff = m_EffectersMap.Get(effecterID);
596 if (eff)
597 {
599 }
600 }

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

Используется в ItemBase::PlayCatchParticleSynced() и ActionFishingNew::PlaySplashEffectSynced().

◆ StartParticleServer()

static void StartParticleServer ( int effecterID)
inlinestaticprotected
612 {
613 EffecterBase eff = m_EffectersMap.Get(effecterID);
614 if (eff)
615 {
616 eff.Start();
617 }
618
619 }

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

◆ Stop()

static void Stop ( int effect_id)
inlinestaticprotected

Stops the Effect.

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

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

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

◆ StopParticleServer()

static void StopParticleServer ( int effecterID)
inlinestaticprotected
622 {
623 EffecterBase eff = m_EffectersMap.Get(effecterID);
624 if (eff)
625 {
626 eff.Stop();
627 }
628 }

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

Поля

◆ 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_EffectersMap

◆ 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_FreeEffecterIDs

ref array<int> m_FreeEffecterIDs
staticprotected

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

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

◆ 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_HighestFreeEffecterID

int m_HighestFreeEffecterID = 1
staticprotected

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

◆ 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().


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