CookingLiquidVisual
A class in Root.Township, Alta.Cooking.
Liquid surface visual for cooking containers. Moves the surface with fullness, keeps it level, and runs boiling particles and waves from the temperature.
- Listed in Crafting and making
- Inherits or implements
LiquidSurfaceVisual - Nested types
BoilingParticlesStageSetting
Constructors
| Member | What it is |
|---|---|
CookingLiquidVisual() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
10 private and internal fields
| Member | What it is |
|---|---|
private BoilingParticles boilingParticles | Pooled boiling particles in use, or null. |
private AnimationCurve boilingParticlesEmissionMultiplier | Curve from liquid temperature to boiling particle emission. |
private Transform boilingParticlesParent | Transform the boiling particles are spawned under. |
private CookingLiquidVisual.BoilingParticlesStageSetting[] boilingParticlesStages | Per-stage lifetime and height offset settings passed to the boiling particles. |
private ILiquidContainer container | The liquid container in the parent, found in Awake. |
private bool isUsingBoilingParticles | Whether this visual shows boiling particles at all. |
private float maximumPlaneY | Local Y of the surface when full. |
private float minimumPlaneY | Local Y of the surface when empty. |
private Transform surface | Backing field for Surface; moved up and down with fullness and turned to face visual up. |
private Transform topOfLiquidNotRotating | Optional transform kept at the surface height but not rotated. |
Properties
| Member | What it is |
|---|---|
static LiquidSurfaceMaterialCreator MaterialCreator { get; } | Shared creator for the surface material and its shader property ids. |
Transform Surface { get; } | The surface plane transform. |
Methods
| Member | What it is |
|---|---|
override void SetFullness(float newFullness) | Moves the surface between the min and max plane heights. Releases boiling particles when empty and clears them when the level drops by 0.1 or more. |
override void SetLiquid(LiquidData liquid) | Sets the liquid and sets the boiling particles up for it. |
void UpdateBoilingEmissionFromTemperature(float temperature, bool isForced = false) | Spawns, updates or releases boiling particles and sets wave speed and strength from the temperature. |
protected override void Awake() | Finds the parent ILiquidContainer. |
protected override void OnDisable() | Resets the surface rotation to the container's up. |
protected override void OnValidate() | Editor: makes sure there is at least one boiling particle stage. |
protected override void SetLODRendererPropertyBlockFromLiquid(MaterialPropertyBlock propertyBlock, LiquidData liquid) | Sets the LOD renderer colour to the liquid's tinted colour. |
protected override void SetPropertyBlockFromLiquid(MaterialPropertyBlock propertyBlock, LiquidData liquid) | Sets the surface colour to the liquid's tinted colour. |
protected override Material SetupMaterialFromLiquidVisualSettings(LiquidVisualData visualSettings, Material materialTemplate) | Builds the surface material from the liquid's visual settings. |
protected override void UpdateVisual() | Keeps the surface facing LiquidGravity.VisualUp. |
2 private and internal methods
Used in
Members of other types that take, return or hold a CookingLiquidVisual: