LiquidHeatAreaController
A class in Root.Township, Alta.Liquid.
Server: turns a heat area (and optionally a heat point collider) on while a liquid container has liquid in it, and sets the heat point's volume from the fill level.
- Listed in Stats, effects, heat and liquid
- Inherits or implements
MonoBehaviour - Documented in Liquids
Constructors
| Member | What it is |
|---|---|
LiquidHeatAreaController() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
7 private and internal fields
| Member | What it is |
|---|---|
private bool hasCollider | Whether heatPointCollider is set. |
private HeatArea heatAreaToControl | The heat area switched on and off. |
private float[] heatAreaVolumePerLiquidLevel | Heat point volume for each liquid level, indexed by level. |
private Collider heatPointCollider | Optional collider object turned on and off with the heat area. |
private HeatPoint heatPointToSetVolumeOff | Heat point whose volume is set from the fill level. |
private bool isSettingVolumeOfHeatPoint | Whether to set the heat point volume when the container fills. |
private LiquidContainer liquidContainer | The container watched for level changes. |
Methods
4 private and internal methods
| Member | What it is |
|---|---|
private void Awake() | Hooks the container's level change event. |
private void OnValidate() | Editor: fills in default volumes per level if none are set and logs an error for any volume of 0 or less. |
private void SetHeatAreaEnabled(ILiquidContainer container, int oldLevel, int newLevel) | Server: on going from empty to filled, turns the heat area on and sets the heat point volume; on emptying, turns it off. |
private void Start() | Applies the current fill level once. |