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
| Member | What it is |
|---|
protected AbstractDockEvents() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
3 private and internal fields
| Member | What it is |
|---|
private PickupDock dock | The dock whose events are watched. |
private bool isRunOnClient | Whether the callbacks run on clients. |
private bool isRunOnServer | Whether the callbacks run on the server. |
Methods
| Member | What 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
| Member | What 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. |