Skip to main content

CraftedDocks

A class in Root.Township, Alta.Inventory.

Manages docks on a crafted part: shows or hides them (and a storage visual) when the assembly's root pickup is docked or undocked, and blocks disassembly while they hold items.

Constructors​

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

Fields​

5 private and internal fields
MemberWhat it is
private CraftingPart craftingPartThe crafting part whose root is watched.
private PickupDockGroup docksThe docks this controls.
private bool isDisablingDocksWhether the dock GameObjects are hidden too, not just the storage visual.
private Pickup rootPickupThe current root pickup being watched.
private CurveScaler storageOptional scaled visual that is hidden while docks are disabled.

Properties​

1 private and internal property
MemberWhat it is
private bool Alta.Crafting.IBlockDisassembly.CanDisassemble { get; }False while any of the docks holds an item.

Methods​

5 private and internal methods
MemberWhat it is
private void Awake()Starts listening for crafting root changes.
private void ChangedRoot(CraftingPart newRoot)Moves the dock and undock listeners to the new root pickup and disables docks if it's already docked.
private void DisableDocks(Interactor interactor, Pickup pickup, PickupDock pickupDock)Hides the storage visual and, if isDisablingDocks is set, the docks too.
private void EnableDocks(Interactor interactor, Pickup pickup, PickupDock pickupDock)Turns the docks and the storage visual back on.
private void Start()Disables the docks if the root pickup is this part's own pickup.