DistanceLODGroup
A class in Root.Township, the global namespace.
Client: a simple LOD group that switches renderer sets on and off by the local player's distance, driven by a shared DistanceLODGroupManager. Removes itself on a headless server.
- Listed in Global namespace: C to D
- Inherits or implements
MonoBehaviour
Constructors
| Member | What it is |
|---|---|
DistanceLODGroup() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|---|
private Transform cachedTransform | The group's own transform, cached in Awake. |
private int lastLevel | The LOD level currently shown, or -1 when the viewer is past the last level's distance (nothing shown). |
private Vector3 lastPosition | The cached world position that Position returns. |
private DistanceLOD[] lods | The LOD levels, nearest first, each with its renderers and squared switch distance. |
private static DistanceLODGroupManager manager | One DistanceLODGroupManager shared by every group, created by the first group that is enabled. |
Properties
| Member | What it is |
|---|---|
int LODCount { get; } | Number of LOD levels. |
DistanceLOD[] LODs { get; } | The LOD levels, each with a squared distance and renderers. |
float MaxDistanceSquared { get; } | Squared distance of the last level. Beyond this nothing is shown. |
Vector3 Position { get; } | World position of the group, refreshed only when the transform has moved. |
Methods
5 private and internal methods
Used in
Members of other types that take, return or hold a DistanceLODGroup: