Class SetBiomeAreaOnSpawn
Sizes its LocalProceduralBiome polygon to cover a fixed world-space area (width by length), centered on the biome, after it is spawned from a template. The explicit-size counterpart to SnapBiomeToTilesOnSpawn, for when the biome should cover a set area rather than fit the terrain. Only touches the XZ polygon, so it composes with a separate height component.
[RequireComponent(typeof(LocalProceduralBiome))]
[AddComponentMenu("Vista/Biome Template/Set Biome Area On Spawn")]
public class SetBiomeAreaOnSpawn : MonoBehaviour, IBiomeTemplateSpawnCallbackReceiver
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourSetBiomeAreaOnSpawn
- Implements
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.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.transformComponent.gameObjectComponent.tagObject.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.InstantiateAsync<T>(T, InstantiateParameters)Object.InstantiateAsync<T>(T, Vector3, Quaternion, InstantiateParameters)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.ToString()Object.nameObject.hideFlags
Remarks
Implements IBiomeTemplateSpawnCallbackReceiver so it runs on spawn, and offers a context-menu re-apply. Pure runtime, no editor dependency. Use at most one XZ sizing component per biome (this or SnapBiomeToTilesOnSpawn), they both write the anchor polygon.
Properties
- worldArea
The world-space area the biome should cover (X width, Y length).
Methods
- ApplyArea()
Set the biome's anchor polygon to a worldArea rectangle centered on the biome, in the same winding as
LocalProceduralBiome.Reset. Local space with unit XZ scale (the spawn transform), so the local extents map one to one to world units.
- OnSpawnedFromBiomeTemplate(BiomeTemplate, BiomeTemplateSpawnContext)
Sizes the biome polygon as part of the template spawn.