EntitySpawnTest
A class in Root.Township, the global namespace.
Debug stress test that spawns or destroys a number of copies of a network prefab every frame through its entity's spawner.
- Listed in Global namespace: E to H
- Inherits or implements
MonoBehaviour
Constructors
| Member | What it is |
|---|---|
EntitySpawnTest() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
9 private and internal fields
| Member | What it is |
|---|---|
private List<NetworkEntity> currentlySpawned | Entities spawned and not yet destroyed. |
private NetworkEntity entity | This object's entity, whose spawner is used. |
private int existingCount | How many spawned entities still exist. |
private bool isDeletingAll | Inspector button that destroys all spawned entities. |
private bool isDeletingOld | When on, destroys the oldest spawned entities each frame. |
private bool isSpawning | When on, spawns new entities each frame. |
private int numberToSpawnEachFrame | How many to spawn or destroy per frame. |
private NetworkPrefab prefabToSpawn | The network prefab to spawn. |
private int spawnedCount | Total spawned so far. |
Methods
3 private and internal methods
| Member | What it is |
|---|---|
private void Awake() | Finds the NetworkEntity on the same object. |
private void OnValidate() | When the Delete All button is pressed, destroys every spawned entity. |
private void Update() | Destroys the oldest spawned entities and/or spawns new ones, numberToSpawnEachFrame at a time, and updates the counters. |