A class in Root.Township, Alta.Heat.
A trigger that smothers fires: any asphyxiable HeatSourceBase whose heat point collider enters it is asphyxiated until it leaves.
Constructors
| Member | What it is |
|---|
FireExtinguisher() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
3 private and internal fields
| Member | What it is |
|---|
private int heatPointLayer | Index of the HeatPoint layer, set in Awake. |
private Dictionary<Collider, HeatSourceBase> sourcesMap | Heat sources currently being smothered, keyed by the collider that entered. |
private Coroutine validationRoutine | The running EnsureHeatSourcesAreValid coroutine, or null when nothing is held. |
Methods
4 private and internal methods
| Member | What it is |
|---|
private void Awake() | Caches the HeatPoint layer index. |
private IEnumerator EnsureHeatSourcesAreValid() (iterator) | Coroutine that runs while any source is held, releasing and dropping entries whose source was destroyed or whose collider was disabled. |
private void OnTriggerEnter(Collider other) | When a collider on the HeatPoint layer enters, finds its HeatSourceBase (on the rigidbody or the collider) and asphyxiates it if it can be. |
private void OnTriggerExit(Collider other) | Releases the asphyxiation on the heat source tied to the leaving collider. |