Skip to main content

DockedOffset

A class in Root.Township, Alta.Inventory.

Moves a transform between two local positions when its pickup (or the crafted assembly's root pickup) is docked or undocked.

Constructors​

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

Fields​

9 private and internal fields
MemberWhat it is
private CraftingPart craftingPartCrafting part used to follow the assembly's root pickup.
private AltaEvent dockedEvent fired on dock.
private Vector3 dockedLocalPositionLocal position while docked.
private int minimumSizeSmallest assembly size whose root pickup is followed.
private Pickup pickupThis object's own pickup.
private Transform toMoveThe transform that is moved.
private CraftingPart topThe root crafting part currently followed.
private AltaEvent undockedEvent fired on undock.
private Vector3 undockedLocalPositionLocal position while not docked.

Methods​

MemberWhat it is
override void Initialize()Hooks the pickup's dock events and the crafting part's root changes.
3 private and internal methods
MemberWhat it is
private void Docked(Interactor arg1, Pickup arg2, PickupDock arg3)Moves toMove to dockedLocalPosition and fires docked.
private void RootChanged(CraftingPart newTop)Moves the listeners to the new root pickup, if the assembly is at least minimumSize.
private void Undocked(Interactor arg1, Pickup arg2, PickupDock arg3)Moves toMove to undockedLocalPosition and fires undocked.