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.
- Listed in Items, inventory and logic
- Inherits or implements
NetworkEntityBehaviour
Constructors
| Member | What it is |
|---|---|
DockedOffset() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
9 private and internal fields
| Member | What it is |
|---|---|
private CraftingPart craftingPart | Crafting part used to follow the assembly's root pickup. |
private AltaEvent docked | Event fired on dock. |
private Vector3 dockedLocalPosition | Local position while docked. |
private int minimumSize | Smallest assembly size whose root pickup is followed. |
private Pickup pickup | This object's own pickup. |
private Transform toMove | The transform that is moved. |
private CraftingPart top | The root crafting part currently followed. |
private AltaEvent undocked | Event fired on undock. |
private Vector3 undockedLocalPosition | Local position while not docked. |
Methods
| Member | What it is |
|---|---|
override void Initialize() | Hooks the pickup's dock events and the crafting part's root changes. |
3 private and internal methods
| Member | What 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. |