Skip to main content

AbstractDockEvents

An abstract class in Root.Township, Alta.Inventory.

Base component that turns a PickupDock's dock and undock events into first, each, last and undock callbacks. Can be limited to server or client.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private PickupDock dockThe dock whose events are watched.
private bool isRunOnClientWhether the callbacks run on clients.
private bool isRunOnServerWhether the callbacks run on the server.

Methods​

MemberWhat it is
protected abstract void FirstDocked()Called when the first item goes into an empty dock.
protected abstract void ItemDocked()The private handler calls FirstDocked when the dock now holds 1, then the abstract ItemDocked.
protected abstract void ItemUndocked()The private handler calls LastUndocked when the dock is now empty, then the abstract ItemUndocked.
protected abstract void LastUndocked()Called when the last item leaves the dock.
4 private and internal methods
MemberWhat it is
private void Awake()Hooks the dock's ItemDocked and ItemUndocked events, if ShouldRun allows it on this side.
private void ItemDocked(Interactor interactor, Pickup pickup, PickupDock dock)The private handler calls FirstDocked when the dock now holds 1, then the abstract ItemDocked.
private void ItemUndocked(Interactor interactor, Pickup pickup, PickupDock dock)The private handler calls LastUndocked when the dock is now empty, then the abstract ItemUndocked.
private bool ShouldRun()True in local tests; otherwise uses isRunOnServer or isRunOnClient for the current side.