Skip to main content

EmptyDockAfterTimePeriod

A class in Root.Township, the global namespace.

Server only: empties a dock on start and again a set time after each item is docked. Removes itself on clients.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private Timeline.IEntry destroyDockedTimerThe pending Timeline entry that will empty the dock.
private PickupDock dockThe dock to empty.
private float resetTimeInMinutesMinutes after docking before the dock is emptied (5 by default).

Methods​

4 private and internal methods
MemberWhat it is
private void DestroyItem()Destroys everything stored in the dock.
private void OnDestroy()Unhooks the dock event and cancels the timer.
private void Start()Server: empties the dock and hooks ItemDocked. Client: destroys this component.
private void StartDestroyTimer(Interactor interactor, Pickup pickup, PickupDock dock)Starts a timer to empty the dock after resetTimeInMinutes. A new dock replaces the stored timer without cancelling the old one.