Skip to main content

AdditionalOwnedDock

A class in Root.Township, Alta.Crafting.

A PickupDock on a crafting part that takes player ownership from the dock its root part sits in. It refuses all docking and interaction while the part has no root.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private Pickup basePickupPickup of the crafting part's current root.
private bool hasPickupTrue while there is a root pickup being tracked.
private CraftingPart trackingThe crafting part whose root is followed.

Properties​

MemberWhat it is
override bool AllowContainerInteraction { get; }Uses the root pickup's dock setting while that pickup is docked, otherwise its own.

Methods​

MemberWhat it is
override void Initialize()After a short delay, adds the blocking filters if no root pickup was found.
protected override void Awake()Starts listening for root changes on the tracked crafting part.
6 private and internal methods
MemberWhat it is
private void CheckDockFilter(Interactor interactor, Pickup pickup, ref bool result)Dock filter that blocks every pickup. Active while there is no root.
private void CheckInteractionFilter(Interactor interactor, Interactable interactable, ref bool result)Interaction filter that blocks everything. Active while there is no root.
private void DeregisterDock(Interactor interactor, Pickup pickup, PickupDock dock)On the root undocking: clears ownership and turns the pickup range back on.
private void RegisterDock(Interactor interactor, Pickup pickup, PickupDock dock)On the root docking: copies the dock's player ownership (now or when it updates) and turns off pickup range if that dock disallows extra docks.
private void RootChanged(CraftingPart newRoot)Moves the dock and undock hooks to the new root's pickup, resetting ownership; with no root, adds the blocking filters.
private void UpdateOwnership(PickupDock dock)Copies ownership from a dock once it becomes owned by a player.