Skip to main content

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).

Constructors​

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

Fields​

5 private and internal fields
MemberWhat it is
private LiquidContainer containerThe liquid container on this pickup.
private PickupLiquidContainerEnabler.DockingElibility dockingElibilityWhenFullWhich docks a non-empty container may go in: none, physical only (default), or all.
private Pickup pickupThe pickup that holds the container.
private PourableContainer pourableOptional pourable turned off while docked out of sight.
private LiquidSurfaceVisual surfaceVisualOptional liquid surface visual turned off while docked out of sight.

Methods​

5 private and internal methods
MemberWhat 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.