GenerationStarter
A class in Root.Township, the global namespace.
Network entity that spawns a GenerationCore and runs procedural generation from a saved seed. The server generates and sends the seed so clients generate the same result.
- Listed in Global namespace: E to H
- Inherits or implements
NetworkEntityBehaviour,ISavable<GenerationStartSaveData>,ISavableSave<GenerationStartSaveData>,ISavableSaveBase - Derived types
GenerationStartSaveData
Constructors
| Member | What it is |
|---|---|
GenerationStarter() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
8 private and internal fields
| Member | What it is |
|---|---|
private GeneratedBiome biome | Biome being generated. |
private GenerationCore core | The spawned generation core. |
private bool isFirstThisRuntime | False when loaded from a save made in this same run. |
private GenerationCore prefab | Generation core prefab to spawn. |
private BiomePreset preset | Optional biome preset that sets the biome. |
private int seed | Random seed for generation. |
private MethodSync sync | Method sync (SpawnSeed). |
private uint terrainModificationId | ID from TerrainModificationRegister that marks whether terrain changes need to be made. |
Methods
| Member | What it is |
|---|---|
override void Initialize() | Sets up the seed sync and creates the generation core as a child. |
override void InitializeAsServer(SpawnData spawnData) | Server: picks a seed when first generating, then generates with it. |
override void OnConnected(Player player) | Sends the seed and settings to a joining player. |