LiquidContainerTrigger
A class in Root.Township, Alta.Liquid.
Trigger inside a liquid container (a bucket, a pot, the river) that tracks objects dipped into the liquid, plays splashes, and on the server fills a dipped container when it is pulled out.
- Listed in Stats, effects, heat and liquid
- Inherits or implements
MonoBehaviour - Documented in Liquids
Constructors
| Member | What it is |
|---|---|
LiquidContainerTrigger() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
9 private and internal fields
| Member | What it is |
|---|---|
private Dictionary<Rigidbody, ILiquidContainer> handledLiquidContainers | Liquid containers inside the trigger, by rigidbody. |
private Dictionary<Rigidbody, Pickup> handledPickups | Pickups inside the trigger, by rigidbody. |
private Dictionary<Rigidbody, IPourableContainer> handledPourableLiquidContainers | Pourable containers marked as submerged, by rigidbody. |
private Dictionary<Rigidbody, int> handledRigidbodies | Rigidbodies inside the trigger and how many of their colliders are in. |
private bool isPlayingSplashParticles | Whether to play splash effects (default true). |
private bool isSurfaceStatic | For still water like the river: uses a simpler way to place splashes. |
private static Logger logger | NLog logger for this class. |
private Transform surfaceTransform | The liquid surface: the cooking liquid's surface if there is one, else the trigger's parent. |
private ILiquidContainer thisContainer | The liquid container this trigger belongs to. |
Methods
6 private and internal methods
| Member | What it is |
|---|---|
private void Awake() | Finds the parent liquid container and its surface, and turns the trigger on or off by whether it holds liquid. |
private void ContainerContentLevelChanged(ILiquidContainer container, int oldLevel, int newLevel) | Turns the trigger off and forgets tracked objects when the container is empty, and back on when it has liquid. |
private void FillOtherContainer(ILiquidContainer otherContainer) | Server: fills a lower-priority container that left the liquid with as much as fits and is available. |
private void PlayLiquidSplashParticles(Collider otherObj) | Plays a splash in the liquid's colours, and the splash sound, where the object meets the surface. |
private void RemoveDockedPickupFromLiquidTrigger(Interactor arg1, Pickup pickup, PickupDock arg3) | Stops tracking a pickup that got docked while in the liquid. |
private void RemoveRigidbodyFromLiquidTriggerArea(Rigidbody attachedRigidbody) | Stops tracking a rigidbody, clears its submerged flag and, on the server, fills it if it is a container. |
Used in
Members of other types that take, return or hold a LiquidContainerTrigger: