CookingLiquid
A class in Root.Township, Alta.Cooking.
The liquid inside a cooking pot: links the pot's liquid container to its heat point, boiling visuals and sounds. Found on the cooking pot prefab under an ILiquidContainer.
- Listed in Crafting and making
- Inherits or implements
NetworkEntityBehaviour - Documented in Cooking
Constructors
| Member | What it is |
|---|---|
CookingLiquid() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|---|
private ILiquidContainer liquidContainer | Backing field for LiquidContainer. |
private CookingLiquidVisual potLiquid | The liquid visual: surface and boiling effect. |
private AudioControl spawnedAudio | Private: the playing boiling sound. |
private RTPCValue temperatureRTPCValue | Private: Wwise parameter fed the water temperature for the boiling sound. |
private CookingPoint waterHeatPoint | Backing field for HeatPoint. A CookingPoint holding the water temperature. |
Properties
| Member | What it is |
|---|---|
HeatPoint HeatPoint { get; } | The heat point that holds the water's temperature. |
bool IsNotEmpty { get; } | True when the parent liquid container has any content. |
bool IsRejectingMoreLiquid { get; set; } | Set by CookingPot to stop more liquid being added, for example while it holds a stew. |
ILiquidContainer LiquidContainer { get; } | The liquid container found in the parent objects. |
Transform Surface { get; } | The transform at the visible liquid surface. Boiling sounds play from here. |
float Temperature { get; } | The current water temperature from the heat point. |
Events
Methods
| Member | What it is |
|---|---|
void ConvertContainerLiquidToStewLiquid(LiquidContent stewLiquidContent) | Replaces the container's content with the given stew liquid. Called by StewManager when a stew forms. |
override void Initialize() | Hooks scene destroy so the pooled boiling sound is released. |
8 private and internal methods
| Member | What it is |
|---|---|
private void AdjustWaterTemperature() | Private: pulls the water heat point fully to ambient temperature when water is added. |
private void Awake() | Finds the liquid container in the parents and hooks its level changes and the heat point's changes. |
private void LiquidContainerContentLevelChanged(ILiquidContainer container, int oldLevel, int newLevel) | Private, server: raises LiquidAdded, WaterRemoved or LiquidEmptied as the level changes. Clients unhook on the first change. |
private void ReceivedWater() | Private: resets the water temperature and raises LiquidAdded. |
private void ReleasePooledAudio() | Private: stops the boiling sound. Called when the entity is destroyed. |
private void Start() | Private: sets the starting boil effect and prepares the temperature sound parameter. |
private void UpdateLiquidSounds(float temperature) | Private, client: plays or updates the boiling sound once the water is above the minimum stewing temperature. |
private void UpdateWaterBoilingEffects(HeatPoint heatPoint) | Private: updates the boil visuals and sound when the heat point changes. |
Used in
Members of other types that take, return or hold a CookingLiquid: