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.
- Listed in Items, inventory and logic
Constructors
| Member | What it is |
|---|---|
PickupDocker(Pickup pickup) | Creates a PickupDocker from pickup. |
Fields
5 private and internal fields
| Member | What it is |
|---|---|
private List<Collider> disabledColliders | Colliders turned off while docked, to turn back on later. |
private static Logger logger | Logger for docking errors. |
private Pickup pickup | The pickup this docker belongs to. |
private MethodSyncStruct<RequestDockArguments> requestDock | The method sync used to send docking messages. |
private int undockedLayer | The pickup's layer before docking (docked pickups move to the UI layer). |
Properties
| Member | What it is |
|---|---|
PickupDock CurrentDock { get; private set; } | The dock the pickup is in, or null. |
1 private and internal property
| Member | What it is |
|---|---|
private NetworkEntity PickupEntity { get; } | The pickup's network entity. |
Events
| Member | What it is |
|---|---|
event PickupDockInteractionHandler Docked | Raised after the pickup has docked. |
event PickupDockInteractionHandler PreDocked | Raised just before the pickup docks, before it's parented to the dock. |
event PickupDockInteractionHandler Undocked | Raised after the pickup has left a dock. |
Methods
| Member | What 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
| Member | What 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: