78 eff.SetPosition(obj.GetPosition());
108 ErrorEx(
string.Format(
"Failed to stop Effect with ID %1. The ID is not registered in m_EffectsMap!",
effect_id));
268 effect.SetAutodestroy(
true);
309 if (
effect.IsRegistered())
321 effect.Event_OnRegistered(
id);
324 ErrorEx(
"Attempted to register Effect while SEffectManager is cleaning up, request ignored.",
ErrorExSeverity.WARNING);
344 effect.Event_OnUnregistered();
497 Print(
"--- SEffectManager Cleanup dump - Begin ------------------------");
505 eff.Event_OnUnregistered();
507 Print(
string.Format(
"%1 :: %2 :: %3",
eff,
typename.EnumToString(
EffectType,
eff.GetEffectType()),
eff.GetDebugName()));
512 Print(
"--- SEffectManager Cleanup dump - End --------------------------");
EffectType
Enum to determine what type of effect the Effect is.
Wrapper class for managing particles through SEffectManager.
Wrapper class for managing sound through SEffectManager.
Manager class for managing Effect (EffectParticle, EffectSound)
static void Event_OnSoundWaveEnded(EffectSound effect_sound)
Event called from EffectSound.Event_OnSoundWaveEnded.
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 void EffectUnregister(int id)
Unregisters Effect in SEffectManager.
static void Cleanup()
Cleanup method to properly clean up the static data.
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 int GetFreeEffectID()
Helper function for EffectRegister to decide an Effect ID.
static ref array< int > m_FreeEffectIDs
Static array of IDs that were previously used, but freed up by unregistering.
static const int INVALID_ID
As the counter starts at 1, Effect ID can never be 0.
static int PlayInWorld(notnull Effect eff, vector pos)
Play an Effect.
static ref ScriptInvoker Event_OnFrameUpdate
Static invoker for the SEffectManager.Event_OnFrameUpdate called form MissionGameplay....
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 Effect GetEffectByID(int effect_id)
Gets the Effect with the given registered Effect ID.
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.
static ref map< int, ref Effect > m_EffectsMap
Static map of all registered effects <id, Effect>
static int m_HighestFreeEffectID
Counter for quickly getting the next ID if FreeEffectIDs array is empty.
static bool m_IsCleanup
Bool to check whether Cleanup is happening, which means that the maps should no longer be accessed.
static void Init()
Initialize the containers.
static void Stop(int effect_id)
Stops the Effect.
static SoundParams GetCachedSoundParam(string soundset)
Get or create a cached SoundParams object.
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 bool m_IsInitialized
Bool to check whether Init was called.
static bool IsEffectExist(int effect_id)
Checks whether an Effect ID is registered in SEffectManager.
static bool DestroySound(EffectSound sound_effect)
Legacy, backwards compatibility.
static void EffectUnregisterEx(Effect effect)
Unregisters Effect in SEffectManager.
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 ref map< string, ref SoundParams > m_ParamsMap
Static map of cached sound params, to prevent having to recreate them.
static int EffectRegister(Effect effect)
Registers Effect in SEffectManager.
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
static void Event_OnFrameUpdate(float time_delta)
Event called on frame.
ScriptInvoker Class provide list of callbacks usage:
proto native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.