PickupLiquidContainerEnabler
A class in Root.Township, Alta.Liquid.
Controls whether a liquid container item can dock while full and keeps its liquid, pouring and surface visual off while it is in a non-physical dock (such as an inventory slot).
- Listed in Stats, effects, heat and liquid
- Inherits or implements
MonoBehaviour - Nested types
DockingElibility - Documented in Liquids
Constructors
| Member | What it is |
|---|---|
PickupLiquidContainerEnabler() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|---|
private LiquidContainer container | The liquid container on this pickup. |
private PickupLiquidContainerEnabler.DockingElibility dockingElibilityWhenFull | Which docks a non-empty container may go in: none, physical only (default), or all. |
private Pickup pickup | The pickup that holds the container. |
private PourableContainer pourable | Optional pourable turned off while docked out of sight. |
private LiquidSurfaceVisual surfaceVisual | Optional liquid surface visual turned off while docked out of sight. |
Methods
5 private and internal methods
| Member | What it is |
|---|---|
private void Awake() | Hooks the pickup's dock and undock events, its dock filter, and the container's add filter. |
private void FilterLiquidAdding(LiquidData liquidData, ref bool result) | Blocks adding liquid to a docked container unless dockingElibilityWhenFull allows that dock. |
private void FilterLiquidDocking(Interactor interactor, PickupDock dock, ref bool result) | Blocks docking a container with liquid in it unless dockingElibilityWhenFull allows that dock. |
private void HandleDockedLiquidContainer(Interactor interactor, Pickup pickup, PickupDock dock) | On dock or undock, turns the container, pourable and surface visual on only if it holds liquid and is loose or in a physical dock. |
private bool ShouldLiquidBeEnabled() | True when the pickup is in a dock whose settings count it as physical. |