Skip to main content

LifeTimeEffect

A class in Root.Township, the global namespace.

Spawns one pooled effect on request and releases it later, so only one copy is alive at a time.

Constructors​

MemberWhat it is
LifeTimeEffect()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

2 private and internal fields
MemberWhat it is
private PooledObjectDefinition effectDefinitionPool definition of the effect.
private PooledObject pooledEffectThe live effect, or null.

Methods​

MemberWhat it is
void ReleaseEffect()Returns the effect to its pool.
void SetEffect(PooledObjectDefinition effectDefinition)Changes which pooled effect to spawn.
void SpawnAt(Transform target)Spawns the effect at a transform's position and rotation, if one isn't already alive.
void SpawnAtParented(Transform target)Spawns the effect as a child of a transform, if one isn't already alive.