Registers Effect in SEffectManager.
- Заметки
- Already handled in SEffectManager Create/Play methods
-
This will make SEffectManager hold a strong ref for the Effect
- Аргументы
-
| effect | Effect The Effect to register |
- Возвращает
int The Effect ID
См. определение в файле EffectManager.c строка 331
332 {
333 if (effect.IsRegistered())
334 {
335 ErrorEx(
string.Format(
"Attempted to register Effect '%1' which was already registered.", effect.GetDebugName()),
ErrorExSeverity.INFO);
336 return effect.GetID();
337 }
338
339 int id;
340
342 {
345 effect.Event_OnRegistered(id);
346 }
347 else
348 ErrorEx(
"Attempted to register Effect while SEffectManager is cleaning up, request ignored.",
ErrorExSeverity.WARNING);
349
350 return id;
351 }
static int GetFreeEffectID()
Helper function for EffectRegister to decide an Effect ID.
static ref map< int, ref Effect > m_EffectsMap
Static map of all registered effects <id, Effect>
static bool m_IsCleanup
Bool to check whether Cleanup is happening, which means that the maps should no longer be accessed.
Перекрестные ссылки Effect(), ErrorEx, GetFreeEffectID(), m_EffectsMap и m_IsCleanup.
Используется в CreateSound(), Car::HandleDoorsSound(), Car::HandleEngineSound(), HandleEngineSound(), Car::HandleSeatAdjustmentSound(), Motorbike_01_ColorBase::OnAnimationPhaseStarted(), Truck_01_Base::OnAnimationPhaseStarted(), PlayInWorld() и PlayOnObject().