EmberComposerFireEffect
A class in Root.Township, the global namespace.
Pooled fire effect used by the EmberComposer skill: particle systems plus a light that fades in when lit and fades out on release.
- Listed in Global namespace: E to H
- Inherits or implements
PooledObject,IBuildRendererPostBake,IBuildBakeable
Constructors
| Member | What it is |
|---|---|
EmberComposerFireEffect() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
10 private and internal fields
| Member | What it is |
|---|---|
private float baseIntensity | Light intensity from the prefab. |
private bool isLit | Backing field for IsLit. |
private AnimationCurve lightEndMultiplier | Light curve used when not lit. |
private AnimationCurve lightStartMultiplier | Light curve used when lit. |
private Coroutine litCoroutine | The running light fade. |
private float multiplier | Backing field for Multiplier. |
private ParticleSystem[] systems | Child particle systems. |
private Dictionary<ParticleSystem, float> systemsInitialSystems | Each system's original start speed, used by SetSize. |
private PlatformLight target | Light whose intensity is driven. |
private float unmultipliedIntensity | Light intensity from the curve before Multiplier. |
Properties
Methods
9 private and internal methods
| Member | What it is |
|---|---|
private void Awake() | Records the light intensity and each system's start speed, and sets Duration to the longest particle lifetime. |
private IEnumerator DelayRelease() (iterator) | Fades the light multiplier to zero over Duration, waits Duration more for particles to die, then returns to the pool. |
private IEnumerator FadeLight() (iterator) | Coroutine that runs the start or end light curve from the point matching the current intensity. |
private float FindClosestTime(AnimationCurve curve, float value, int steps) | Samples a curve in steps and returns the time whose value is closest to the given one. |
private void OnDisable() | Empty. |
private void Play() | Plays every particle system, without children. |
private void IBuildRendererPostBake.PostBake() | Build step that removes null entries from systems. |
private void RequestedStart(PooledObject pooledObject) | Enables the component when taken from the pool. |
private void Reset() | Sets the multiplier to 1 and turns the light off. |