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
| Member | What it is |
|---|
CookingLiquidVisualTippingPointController() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
3 private and internal fields
Methods
| Member | What it is |
|---|
protected void OnValidate() | Editor: runs SetupSurfaceTipLimits. |
4 private and internal methods
| Member | What 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. |