A class in Root.Township, the global namespace.
Spawner that spawns set counts of several prefabs and distributions into its entity's chunk. Server only.
Constructors
| Member | What it is |
|---|
MultiSpawner() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
4 private and internal fields
| Member | What it is |
|---|
private List<int> count | Backing field for Count. |
private List<Distribution> distributions | Backing field for Distributions. |
private bool isAllSame | If true, each distribution rolls once and spawns that one prefab for its whole count. |
private List<NetworkPrefab> prefabs | Backing field for Prefabs. |
Properties
| Member | What it is |
|---|
List<int> Count { get; } | Spawn counts: first one per prefab, then one per distribution, in that order. |
List<Distribution> Distributions { get; } | Distributions to roll prefabs from, using the chunk's biome attributes. |
List<NetworkPrefab> Prefabs { get; } | Prefabs spawned directly. |
Methods
| Member | What it is |
|---|
override void Spawn() | Server: spawns every prefab and distribution entry by its count, if the entity is in a chunk. The impact overload does the same and ignores the hit. |
void Spawn(ImpactHit impact) | Server: spawns every prefab and distribution entry by its count, if the entity is in a chunk. The impact overload does the same and ignores the hit. |
1 private and internal method
| Member | What it is |
|---|
private void SpawnDistribution(Distribution distribution, int count) | Rolls a prefab from the distribution for each count, or rolls once and spawns that prefab count times if isAllSame is set. |