A class in Root.Township, the global namespace.
Destroys its entity after a set time plus an optional random extra. Server only; a top-level entity with this is never saved.
Constructors
| Member | What it is |
|---|
NetworkDestroyTimed() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
3 private and internal fields
| Member | What it is |
|---|
private Timeline.IEntry entry | Timeline entry for the scheduled destroy. |
private float randomAdditionalTime | Up to this many extra random seconds are added. |
private float time | Seconds before the entity is destroyed. |
Methods
| Member | What it is |
|---|
override void InitializeAsServer(SpawnData spawnData) | Server: stops a top-level entity from saving and schedules Destroy. |
2 private and internal methods
| Member | What it is |
|---|
private void Destroy() | Destroys the entity across the network, first detaching it if it is embedded in a parent. |
private void OnDestroy() | Cancels the scheduled destroy. |