50 eff.SetPosition( pos );
76 eff.SetPosition(local_pos);
80 eff.SetPosition(obj.GetPosition());
84 eff.SetLocalPosition(local_pos);
85 eff.SetAttachedLocalOri(local_ori);
87 if (force_rotation_relative_to_world)
106 static void Stop(
int effect_id)
116 ErrorEx(
string.Format(
"Failed to stop Effect with ID %1. The ID is not registered in m_EffectsMap!", effect_id));
140 static EffectSound CreateSound(
string sound_set,
vector position,
float play_fade_in = 0,
float stop_fade_out = 0,
bool loop =
false,
bool enviroment =
false)
144 effect_sound.SetPosition(position);
186 EffectSound effect_sound =
CreateSound(params.GetName(), position, play_fade_in, stop_fade_out, loop,
false);
245 EffectSound effect_sound =
CreateSound(sound_set, parent_object.GetPosition(), play_fade_in, stop_fade_out, loop);
311 if (effect.IsRegistered())
313 ErrorEx(
string.Format(
"Attempted to register Effect '%1' which was already registered.", effect.GetDebugName()),
ErrorExSeverity.INFO);
314 return effect.GetID();
323 effect.Event_OnRegistered(
id);
326 ErrorEx(
"Attempted to register Effect while SEffectManager is cleaning up, request ignored.",
ErrorExSeverity.WARNING);
346 effect.Event_OnUnregistered();
504 Print(
"--- SEffectManager Cleanup dump - Begin ------------------------");
512 eff.Event_OnUnregistered();
514 Print(
string.Format(
"%1 :: %2 :: %3", eff,
typename.EnumToString(
EffectType, eff.GetEffectType()), eff.GetDebugName() ));
519 Print(
"--- SEffectManager Cleanup dump - End --------------------------");
EffectType
Enum to determine what type of effect the Effect is.
Wrapper class for managing particles through SEffectManager.
void ForceParticleRotationRelativeToWorld(bool state)
Set orientation setting to be used by the effect when the Effect starts.
Wrapper class for managing sound through SEffectManager.
void SetEnviromentVariables(bool setEnvVariables)
Sets whether UpdateEnvSoundControllers needs to be called during Loading.
bool SoundPlay()
Plays sound.
void SetSoundSet(string snd)
Set soundset for the sound.
void SetSoundFadeOut(float fade_out)
Set the sound fade out duration.
override void SetParent(Object parent_obj)
Set parent for the sound to follow.
void SetSoundFadeIn(float fade_in)
Set the sound fade in duration.
bool SoundPlayEx(out SoundParams params)
Plays sound.
void SetSoundLoop(bool loop)
Set if the sound loops.
Manager class for managing Effect (EffectParticle, EffectSound)
static void Stop(int effect_id)
Stops the Effect.
static void Event_OnFrameUpdate(float time_delta)
Event called on frame.
static void Init()
Initialize the containers.
static int PlayInWorld(notnull Effect eff, vector pos)
Play an Effect.
static const int INVALID_ID
As the counter starts at 1, Effect ID can never be 0.
static void Cleanup()
Cleanup method to properly clean up the static data.
static Effect GetEffectByID(int effect_id)
Gets the Effect with the given registered Effect ID.
static ref ScriptInvoker Event_OnFrameUpdate
Static invoker for the SEffectManager.Event_OnFrameUpdate called form MissionGameplay....
static void EffectUnregister(int id)
Unregisters Effect in SEffectManager.
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 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 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 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 protected ref map< int, ref Effect > m_EffectsMap
Static map of all registered effects <id, Effect>
static protected int GetFreeEffectID()
Helper function for EffectRegister to decide an Effect ID.
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 protected bool m_IsCleanup
Bool to check whether Cleanup is happening, which means that the maps should no longer be accessed.
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
static void Event_OnSoundWaveEnded(EffectSound effect_sound)
Event called from EffectSound.Event_OnSoundWaveEnded.
static bool IsEffectExist(int effect_id)
Checks whether an Effect ID is registered in SEffectManager.
static void EffectUnregisterEx(Effect effect)
Unregisters Effect in SEffectManager.
static bool DestroySound(EffectSound sound_effect)
Legacy, backwards compatibility.
static int EffectRegister(Effect effect)
Registers Effect in SEffectManager.
static SoundParams GetCachedSoundParam(string soundset)
Get or create a cached SoundParams object.
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 protected ref map< string, ref SoundParams > m_ParamsMap
Static map of cached sound params, to prevent having to recreate them.
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 protected ref array< int > m_FreeEffectIDs
Static array of IDs that were previously used, but freed up by unregistering.
static protected int m_HighestFreeEffectID
Counter for quickly getting the next ID if FreeEffectIDs array is empty.
static protected bool m_IsInitialized
Bool to check whether Init was called.
ScriptInvoker Class provide list of callbacks usage:
proto void Invoke(void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
invoke call on all inserted methods with given arguments
proto native void Clear()
remove all calls from list
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.