Skip to main content

PickupDocker

A class in Root.Township, Alta.Inventory.

The part of a Pickup that docks it into and out of a PickupDock and syncs that over the network. Both sides; each pickup owns one.

Constructors​

MemberWhat it is
PickupDocker(Pickup pickup)Creates a PickupDocker from pickup.

Fields​

5 private and internal fields
MemberWhat it is
private List<Collider> disabledCollidersColliders turned off while docked, to turn back on later.
private static Logger loggerLogger for docking errors.
private Pickup pickupThe pickup this docker belongs to.
private MethodSyncStruct<RequestDockArguments> requestDockThe method sync used to send docking messages.
private int undockedLayerThe pickup's layer before docking (docked pickups move to the UI layer).

Properties​

MemberWhat it is
PickupDock CurrentDock { get; private set; }The dock the pickup is in, or null.
1 private and internal property
MemberWhat it is
private NetworkEntity PickupEntity { get; }The pickup's network entity.

Events​

MemberWhat it is
event PickupDockInteractionHandler DockedRaised after the pickup has docked.
event PickupDockInteractionHandler PreDockedRaised just before the pickup docks, before it's parented to the dock.
event PickupDockInteractionHandler UndockedRaised after the pickup has left a dock.

Methods​

MemberWhat it is
virtual PickupDock.AllowedResult DockInto(Interactor interactor, PickupDock dock, int quantity, bool isInstantMovementForced = false)Docks the pickup into a dock: checks it's allowed (enforced on the server), undocks from the old one, parents it, hides physics and sends the change.
void InitializeForNetworking()Sets up the docking message sync on the pickup's entity.
void SyncCurrentDockWithPlayer(Player player)Server: tells a joining player which dock this pickup is in.
void Undock(Interactor interactor, bool isScalingBack, int quantity)Takes the pickup out of its dock, restoring layer, physics, colliders and parent, and sends the change.
void UpdateColliders()Re-applies which colliders are off when the dock's content changes.
6 private and internal methods
MemberWhat it is
private void DisableColliders(bool isPhysical, bool isPhysicalTriggersOnly, LayerMask maintainPhysicalLayers)Turns off the pickup's colliders while docked, keeping those on maintained layers and, for physical docks, triggers if set.
private void EnablePhysicalColliders()Turns back on the colliders that DisableColliders turned off.
private void OnDocked(Interactor interactor)Raises Docked.
private void OnPreDocked(Interactor interactor, PickupDock dock)Raises PreDocked.
private void OnUndocked(Interactor interactor, PickupDock dock)Raises Undocked.
private void RequestDock(IPlayer player, Stream stream, RequestDockArguments request)Handles a docking message. The server checks the sender owns the interactor; clients dock or undock as told, waiting for the dock to spawn if needed.

Used in​

Members of other types that take, return or hold a PickupDocker: