Skip to main content

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.

Constructors​

MemberWhat it is
LiquidHeatAreaController()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

7 private and internal fields
MemberWhat it is
private bool hasColliderWhether heatPointCollider is set.
private HeatArea heatAreaToControlThe heat area switched on and off.
private float[] heatAreaVolumePerLiquidLevelHeat point volume for each liquid level, indexed by level.
private Collider heatPointColliderOptional collider object turned on and off with the heat area.
private HeatPoint heatPointToSetVolumeOffHeat point whose volume is set from the fill level.
private bool isSettingVolumeOfHeatPointWhether to set the heat point volume when the container fills.
private LiquidContainer liquidContainerThe container watched for level changes.

Methods​

4 private and internal methods
MemberWhat 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.