Table of Contents

Class SnapBiomeToTilesOnSpawn

Namespace
Pinwheel.Vista
Assembly
Pinwheel.Vista.Runtime.dll

Snaps its LocalProceduralBiome so the biome polygon covers every terrain tile under the Vista Manager. Dropped on a biome template's prefab, it fits the spawned biome to whatever terrain the scene has, so the template covers the full terrain the moment it is created, at any terrain size.

[RequireComponent(typeof(LocalProceduralBiome))]
[AddComponentMenu("Vista/Biome Template/Snap Biome To Tiles On Spawn")]
public class SnapBiomeToTilesOnSpawn : MonoBehaviour, IBiomeTemplateSpawnCallbackReceiver
Inheritance
Object
Component
Behaviour
MonoBehaviour
SnapBiomeToTilesOnSpawn
Implements
Inherited Members
MonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.destroyCancellationToken
MonoBehaviour.useGUILayout
MonoBehaviour.runInEditMode
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.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.transform
Component.gameObject
Component.tag
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.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.name
Object.hideFlags

Remarks

Implements IBiomeTemplateSpawnCallbackReceiver, so it runs automatically right after the biome is spawned from a template (the spawn broadcasts to every receiver in the clone, using the Manager carried on the context). It also exposes a context menu re-fit for manual use. Pure runtime, no editor dependency, so it also works when a biome is spawned from a template at run time.

Methods

OnSpawnedFromBiomeTemplate(BiomeTemplate, BiomeTemplateSpawnContext)

Fits the biome to the spawning Manager's tiles as part of the template spawn.

SnapToTiles()

Re-fit the biome to the tiles under its Vista Manager, resolved from the hierarchy.

SnapToTiles(VistaManager)

Set the biome's anchor polygon to the combined XZ bounds of every tile under manager. Does nothing when there is no manager, no biome, or no tiles, so the biome keeps its authored polygon.