Skip to main content

BasemapDistanceSet

A class in Root.Township, the global namespace.

Sets the Terrain on the same object to a given basemap distance (where it switches to the low detail basemap). Turns itself off on a headless server.

Constructors​

MemberWhat it is
BasemapDistanceSet()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

2 private and internal fields
MemberWhat it is
private float distanceBacking field for Distance (2000 by default).
private Terrain terrainThe terrain on this object.

Properties​

MemberWhat it is
float Distance { get; set; }Basemap distance to apply. Setting it doesn't reapply until the next enable.

Methods​

2 private and internal methods
MemberWhat it is
private void OnEnable()Gets the terrain, disables itself if headless, then applies the distance.
private void Set()Applies the distance to the terrain if it differs. If the terrain wasn't cached yet it only fetches it and doesn't apply.