Skip to main content

SpawnOnDestroyed

A class in Root.Township, the global namespace.

Client: plays a pooled effect where the object was when it is destroyed. Skipped on headless servers and during app quit.

Constructors​

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

Fields​

1 private and internal field
MemberWhat it is
private PooledObjectDefinition poolDefinitionThe pooled effect to spawn.

Methods​

MemberWhat it is
virtual void Awake()Hooks app quit so no effect spawns while shutting down.
2 private and internal methods
MemberWhat it is
private void OnDestroy()Gets the pooled effect at this position and rotation, unless headless or quitting.
private void Quit()Clears the pool definition so OnDestroy does nothing.