Skip to main content

SerializedTimedEvent

A class in Root.Township, the global namespace.

Server: fires a list of events after set delays using the Timeline, and saves pending timers so they survive a restart.

Constructors​

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

Fields​

6 private and internal fields
MemberWhat it is
private bool allowRestartAfterStopWhether StartTimers works again after a stop. Default true.
private bool autoStartStarts the timers when the server initializes the entity. Default true.
private bool hasStartedWhether the timers have been started. Saved.
private static Logger loggerNLog logger for this class.
private SerializedTimedEvent.TimedEventSetup[] setupThe delays and the event each one fires.
private List<SerializedTimedEvent.TimerData> timersPending Timeline entries and their setup index.

Methods​

MemberWhat it is
override void InitializeAsServer(SpawnData spawnData)Server: starts the timers if autoStart is on and they haven't started.
void StartTimers()Schedules every set-up event on the Timeline. Does nothing if already started.
void StopTimers()Cancels all pending timers. If allowRestartAfterStop is on, they can be started again.