Class TerrainDetailBiomes
Which biome's spawn rule made each of a terrain's detail prototypes, beside the terrain (written by the scene cut's scatter, TerrainScatter). The scatter makes one prototype per rule and prefab, so the grass on a terrain is several prototypes of one prefab, each painted where its own biome grows it; with this the client knows which biome's look a prototype's blades take (Biomes.BiomeTemplate.GrassTypes), and that its healthy and dry tints are its rule's.
[DisallowMultipleComponent]
public sealed class TerrainDetailBiomes : MonoBehaviour
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourTerrainDetailBiomes
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.didStartMonoBehaviour.didAwakeMonoBehaviour.runInEditModeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.GetComponent<T>()Component.TryGetComponent<T>(out T)Component.GetComponentInChildren<T>()Component.GetComponentsInChildren<T>()Component.GetComponentInParent<T>()Component.GetComponentsInParent<T>()Component.GetComponents<T>()Component.GetComponentIndex()Component.CompareTag(TagHandle)Component.transformComponent.transformHandleComponent.gameObjectComponent.tagObject.GetEntityId()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.FindObjectsByType<T>()Object.FindObjectsByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Remarks
Keyed by the prototype's prefab name and noise seed, not its index: the scatter seeds every prototype from its rule (a distinct seed per rule and prefab), both survive any copy of the prototype, and a prototype added afterwards (a point of interest's wheat, a hand-painted one) simply has no entry. By name rather than by reference so the record pulls no prefab into a build the terrain's own prototypes do not (the server strips those).
A biome is its cached-object id (Biomes.BiomeRegistry.IDOf), as the scene's biome map stores it, never a reference: a scene reference to a template would pull its art into the scene's bundle.
A point of interest's prototypes (a herb grove's herbs and flowers, a cave mouth's growth, a field's wheat: prototypes a site adds to a tile after the scatter) are recorded too since 2026-10-16, for the biome the site stands in, marked Site: they take that biome's look of the prefab (or the old look where it has none), and keep their material's tints, as they had before, since no rule of the biome chose them.
A site paints its own biome's prototype (2026-10-16, I4b): it reuses a tile's prototype of the plant only when that prototype is its own biome's (a rule's or an earlier site's, SiteLayer(string, int, IReadOnlyList<string>, IReadOnlyList<int>, IReadOnlyList<Entry>, out int)); where the tile's prototype of the plant is another biome's, the site adds one of its own (a copy of that one, with a noise seed of its own, SiteSeed(int, int, string, IReadOnlyList<string>, IReadOnlyList<int>, IReadOnlyList<Entry>)), so the plant takes the look of the biome the site stands in rather than whichever biome's prototype came first. Its cover goes on as before, measured against the plant's prototype it used to paint into (SiteCover(int, int, bool, int)), so a plant is no thicker for being split between two prototypes.
Fields
Prototypes
[Tooltip("Each detail prototype the scatter made from a biome's rule: its prefab's name, its noise seed and the biome's id. Written by the cut; not edited by hand.")]
public List<TerrainDetailBiomes.Entry> Prototypes
Field Value
Methods
BiomeOf(string, int)
The biome id whose rule made a prototype of this prefab and noise seed; 0 when none is recorded.
public int BiomeOf(string prefabName, int noiseSeed)
Parameters
Returns
BiomeOf(Terrain, DetailPrototype)
The biome id recorded for a terrain's prototype; 0 when the terrain has no record or none for it.
public static int BiomeOf(Terrain terrain, DetailPrototype prototype)
Parameters
terrainTerrainprototypeDetailPrototype
Returns
RecordSite(string, int, int)
Records a prototype a point of interest added for the biome it stands in (Site), unless one is recorded already under the same prefab and seed (a rule's, or an earlier site's: a site adds its own prototype, with a seed of its own, wherever the tile's is another biome's, SiteLayer(string, int, IReadOnlyList<string>, IReadOnlyList<int>, IReadOnlyList<Entry>, out int)). True when it added the entry.
public bool RecordSite(string prefabName, int noiseSeed, int biomeID)
Parameters
Returns
SiteCover(int, int, bool, int)
The cover a site leaves in its own prototype of a plant at one detail cell, where it wants want
and grows only ever more: measured, as it always was, against the plant's prototype it used to paint into (the tile's
first of the plant, baseCover) together with its own (ownCover), and only the
difference added to its own. sameLayer: its own is that first one (the tile had no other biome's
prototype of the plant first), so the cell is simply raised to want. Either way the plant's cover
in the two is what one prototype held before.
public static int SiteCover(int baseCover, int ownCover, bool sameLayer, int want)
Parameters
Returns
SiteLayer(string, int, IReadOnlyList<string>, IReadOnlyList<int>, IReadOnlyList<Entry>, out int)
The prototype a point of interest of biome biomeID paints a plant (prefabName)
into on a tile whose prototypes are prefabs (their prefabs' names, null for none) and
seeds (their noise seeds), recorded in entries: the first prototype of the plant
recorded for the same biome (a rule's or an earlier site's), or -1 when there is none and the site adds its own.
first is the tile's first prototype of the plant whatever its biome (-1 when it has none): the one
a site painted into before, which an added prototype copies. A site with no biome (0) takes the first, as before.
public static int SiteLayer(string prefabName, int biomeID, IReadOnlyList<string> prefabs, IReadOnlyList<int> seeds, IReadOnlyList<TerrainDetailBiomes.Entry> entries, out int first)
Parameters
prefabNamestringbiomeIDintprefabsIReadOnlyList<string>seedsIReadOnlyList<int>entriesIReadOnlyList<TerrainDetailBiomes.Entry>firstint
Returns
SiteSeed(int, int, string, IReadOnlyList<string>, IReadOnlyList<int>, IReadOnlyList<Entry>)
The noise seed of a prototype a site adds for its biome: seed (the one it copied), unless a
prototype of the same plant on the tile has it or the record names the plant with it, then hashed with the biome until
neither does, so every prototype of a plant is told apart by its seed (TerrainDetailBiomes.Entry's key). Deterministic: a
re-cut adds the same.
public static int SiteSeed(int seed, int biomeID, string prefabName, IReadOnlyList<string> prefabs, IReadOnlyList<int> seeds, IReadOnlyList<TerrainDetailBiomes.Entry> entries)
Parameters
seedintbiomeIDintprefabNamestringprefabsIReadOnlyList<string>seedsIReadOnlyList<int>entriesIReadOnlyList<TerrainDetailBiomes.Entry>
Returns
TryGet(IReadOnlyList<Entry>, string, int, out Entry)
The entry a list records for a prototype of this prefab and noise seed (the first); false when none is.
public static bool TryGet(IReadOnlyList<TerrainDetailBiomes.Entry> entries, string prefabName, int noiseSeed, out TerrainDetailBiomes.Entry found)
Parameters
entriesIReadOnlyList<TerrainDetailBiomes.Entry>prefabNamestringnoiseSeedintfoundTerrainDetailBiomes.Entry
Returns
TryGet(string, int, out Entry)
The entry recorded for a prototype of this prefab and noise seed; false when none is.
public bool TryGet(string prefabName, int noiseSeed, out TerrainDetailBiomes.Entry found)
Parameters
prefabNamestringnoiseSeedintfoundTerrainDetailBiomes.Entry
Returns
TryGet(Terrain, DetailPrototype, out Entry)
The entry recorded for a terrain's prototype; false when the terrain has no record or none for it.
public static bool TryGet(Terrain terrain, DetailPrototype prototype, out TerrainDetailBiomes.Entry entry)
Parameters
terrainTerrainprototypeDetailPrototypeentryTerrainDetailBiomes.Entry