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.
- Listed in Items, inventory and logic
- Inherits or implements
MonoBehaviour,IBlockDisassembly
Constructors
| Member | What it is |
|---|---|
CraftedDocks() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|---|
private CraftingPart craftingPart | The crafting part whose root is watched. |
private PickupDockGroup docks | The docks this controls. |
private bool isDisablingDocks | Whether the dock GameObjects are hidden too, not just the storage visual. |
private Pickup rootPickup | The current root pickup being watched. |
private CurveScaler storage | Optional scaled visual that is hidden while docks are disabled. |
Properties
1 private and internal property
Methods
5 private and internal methods
| Member | What 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. |