Skip to main content

CookingLiquidVisualTippingPointController

A class in Root.Township, Alta.Cooking.

Component on a cooking liquid visual that sets how far the container can tip before the liquid surface spills, based on how full it is. Visual only.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private LiquidContainer containerThe liquid container whose fill level drives the limits; found in a parent if not set.
private CookingLiquidVisual liquidVisualThe CookingLiquidVisual that gets the tip values.
private CookingLiquidVisualTippingPointController.TippingSettings[] surfaceTipLimitAtDifferentFullnessesTip threshold and visual tip limit for each fill level, one per unit of container size.

Methods​

MemberWhat it is
protected void OnValidate()Editor: runs SetupSurfaceTipLimits.
4 private and internal methods
MemberWhat it is
private void Awake()Hooks the container's shown-amount change to update the tipping point.
private CookingLiquidVisualTippingPointController.TippingSettings GetTipLimitForContainerLevel(int currentContentLevel)Returns the tipping settings for a whole fill level (1-based, clamped to the array).
private void SetupSurfaceTipLimits()Finds the container and liquid visual if unset and resizes the settings array to one entry per unit of container size.
private void SetVisualsTippingPointToNewLiquidLevel(ILiquidContainer container)Blends the tipping settings of the two nearest fill levels and applies the visual tip limit and threshold to the liquid visual.