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.
- Listed in Global namespace: S
- Inherits or implements
NetworkEntityBehaviour,ISavable<TimedEventSaveData>,ISavableSave<TimedEventSaveData>,ISavableSaveBase - Derived types
TimedEventSaveData - Nested types
TimedEventSetup,TimerData
Constructors
| Member | What it is |
|---|---|
SerializedTimedEvent() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
6 private and internal fields
| Member | What it is |
|---|---|
private bool allowRestartAfterStop | Whether StartTimers works again after a stop. Default true. |
private bool autoStart | Starts the timers when the server initializes the entity. Default true. |
private bool hasStarted | Whether the timers have been started. Saved. |
private static Logger logger | NLog logger for this class. |
private SerializedTimedEvent.TimedEventSetup[] setup | The delays and the event each one fires. |
private List<SerializedTimedEvent.TimerData> timers | Pending Timeline entries and their setup index. |
Methods
| Member | What 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. |