Class BiomeTemplateSpawner
Runtime core of a template spawn: instantiate a template's biome prefab as a disconnected clone under a manager, then let each biome in it clone its owned references in memory. No editor dependency, so it works in a build. The editor-side factory wraps this to add persistence, undo, selection, and recents.
public static class BiomeTemplateSpawner
- Inheritance
-
BiomeTemplateSpawner
- Inherited Members
Methods
- Spawn(BiomeTemplate, BiomeTemplateSpawnContext)
Spawn
template's biome prefab under the manager carried bycontextand return the spawned root GameObject. The prefab may hold a single biome on its root or several biomes under a plain root, so the root object is the one handle that always covers the whole spawn; callers locate the biomes throughGetComponentInChildren. The caller owns the context: it creates it with the target manager and reads back the in-memory clones each receiver registered on it, to persist (editor) or ignore (runtime). The context is a class, so it is mutated in place, norefneeded. Throws if a required argument is null or the template is invalid (no prefab, or no IBiome anywhere in the prefab hierarchy); the caller is expected to pass a validated template (see IsValid(out string)), so those throws mark a broken precondition, not a normal outcome.