MultipleSpawner.SimpleSpawner
A class in Root.Township, the global namespace.
One spawn rule inside a MultipleSpawner: a prefab or random distribution, how many, and which spawn points. Server only; runs from MultipleSpawner.Spawn.
Constructors
Fields
9 private and internal fields
| Member | What it is |
|---|
private int count | Backing field for Count (default 1). |
private Distribution distribution | Backing field for Distribution. |
private bool isAllSame | Backing field for IsAllSame. |
private bool isRotationRandom | Backing field for IsRotationRandom (default on). |
private SpawnMethod method | Backing field for Method. |
private int nextId | Index of the last spawn point used in sequence mode. |
private NetworkPrefab prefab | Backing field for Prefab. |
private float radius | Backing field for Radius. |
private Transform[] spawnPoints | Backing field for SpawnPoints. |
Properties
| Member | What it is |
|---|
int Count { get; set; } | How many to spawn. |
Distribution Distribution { get; set; } | Random prefab table used when Prefab is null. |
bool IsAllSame { get; set; } | If on, one random prefab is picked and used for the whole count. |
bool IsRotationRandom { get; set; } | If on, spawns get a random rotation instead of the spawn point's. |
SpawnMethod Method { get; set; } | How spawn points are picked: in sequence (looping) or at random. |
NetworkPrefab Prefab { get; set; } | Fixed prefab to spawn; if null, Distribution picks one each time. |
float Radius { get; set; } | Radius setting; not used by the spawning code here. |
Transform[] SpawnPoints { get; set; } | Transforms to spawn at. |
2 private and internal properties
| Member | What it is |
|---|
private NetworkEntity Entity { get; set; } | The spawner's entity, set by Spawn; its chunk and biome are used. |
private Transform NextSpawnPoint { get; } | Returns the next spawn point based on Method. |
Methods
| Member | What it is |
|---|
void Spawn(NetworkEntity entity) | Spawns the prefabs into the entity's chunk at the spawn points, using the chunk's biome. |
1 private and internal method
| Member | What it is |
|---|
private void Spawn(NetworkPrefab prefab, int count) | Spawns the prefabs into the entity's chunk at the spawn points, using the chunk's biome. |
Used in
Members of other types that take, return or hold a SimpleSpawner: