Skip to main content

TestEntity

A class in Root.Township, the global namespace.

Developer test behaviour with an inspector button that spawns many copies of a prefab as children of this entity.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private bool isSpawningInspector button that calls Spawn.
private int numberToSpawnHow many copies to spawn (100 by default).
private NetworkPrefab prefabPrefab to spawn.

Methods​

2 private and internal methods
MemberWhat it is
private void OnValidate()Reads the button field and does nothing else.
private void Spawn()Spawns numberToSpawn copies of prefab at this transform, saved as children of this entity.