A class in Root.Township, the global namespace.
Build-time bake step that trims a LODGroup to a range of levels on a given platform and deletes the renderers it no longer uses.
Constructors
| Member | What it is |
|---|
PlatformLODController() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
4 private and internal fields
| Member | What it is |
|---|
private bool destroyEmptyObjects | Whether to delete objects left with nothing on them. |
private LODGroup lodGroup | The LOD group being trimmed. |
private static Logger logger | NLog logger for this class. |
private PlatformLODController.PlatformDetails[] platformDetails | Min and max LOD to keep per platform. A max of 100 means not set up. |
Methods
| Member | What it is |
|---|
override void Bake(bool isSaving) | For the first matching platform, points reference renderers at the new first LOD and trims the group. |
2 private and internal methods
| Member | What it is |
|---|
private void BakeToLevel(LOD[] lods, PlatformLODController.PlatformDetails level) | Keeps only LODs from min to max, keeps the last transition height, and removes unused renderers. Warns if max was never set. |
private void RemoveRenderers(IEnumerable<Renderer> renderers) | Destroys the renderers with their mesh filters and vertex streams, and empty objects left behind if set to. |