EffectReleaseOnFade
A class in Root.Township, the global namespace.
Pooled effect that, when released, stops its particle systems and sound and waits for the longest particle duration before going back to the pool.
- Listed in Global namespace: E to H
- Inherits or implements
PooledObject,IBuildRendererPostBake,IBuildBakeable - Derived types
PlayerEffectParticle
Constructors
| Member | What it is |
|---|---|
EffectReleaseOnFade() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
6 private and internal fields
| Member | What it is |
|---|---|
private SoundSource audioToFade | Sound source played on request and stopped on release. |
private Coroutine fadeCoroutine | The fade coroutine in progress. If a fade is cut short, a later Release only stops the old handle and does not release. |
private bool hasAudio | Serialized flag that nothing reads in this build. |
private bool isReleasing | True while the fade-out is running. |
private ParticleSystem[] systemsToFade | Particle systems stopped on release. |
private bool unparentingOnRelease | Detaches the effect from its parent when released, so it can finish fading in place. |
Methods
4 private and internal methods
| Member | What it is |
|---|---|
private void Awake() | Hooks SetupRequest to the pool's request event. |
private void BaseRelease() | Returns the object to the pool and clears the fade state. |
private IEnumerator FadeAndRelease() (iterator) | Coroutine that stops the particles and audio, waits for the longest particle system duration, then releases. |
private void SetupRequest(PooledObject pooledObject) | When taken from the pool, clears the releasing flag and starts the audio. |
Used in
Members of other types that take, return or hold a EffectReleaseOnFade: