Skip to main content

PooledEffectParent

A class in Root.Township, the global namespace.

Client: shows a pooled effect parented to this object while it is enabled, and releases it when disabled or when the parent entity is destroyed.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private PooledObjectDefinition definitionThe pooled effect to show.
private NetworkEntity parentEntityOptional entity whose destruction releases the effect.
private PooledObject pooledThe effect currently shown, or null.

Methods​

4 private and internal methods
MemberWhat it is
private void Awake()Hooks the parent entity's DestroyedByScene to release the effect.
private void OnDisable()Releases the effect on the next timeline tick.
private void OnEnable()Gets a pooled effect from definition under this transform.
private void Released(PooledObject released)Forgets the effect once it has been released.