ParticleMeshReplacePooledObject
A class in Root.Township, the global namespace.
A pooled mesh-replace effect that shows the mesh through particle system renderers and waits a while before going back to the pool.
Constructors
| Member | What it is |
|---|
ParticleMeshReplacePooledObject() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
3 private and internal fields
| Member | What it is |
|---|
private AltaCoroutine releaseRoutine | The running release timer, if any. |
private float releaseTime | Seconds before the object returns to the pool (1 by default). |
private ParticleSystemRenderer[] renderers | Particle renderers that show the mesh. |
Methods
| Member | What it is |
|---|
override void Setup(Mesh mesh, Material material) | Sets the mesh and material on every particle renderer. |
3 private and internal methods
| Member | What it is |
|---|
private void Awake() | Hooks the pool's Requested event to start the delayed release. |
private IEnumerator DelayedRelease(float releaseTime) (iterator) | Coroutine that waits releaseTime seconds and then releases the object to the pool. |
private void DelayRelease(PooledObject pooledObject) | Restarts the release timer whenever the object is taken from the pool. |