Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetLODs()

Returns the array of LODs.
Read time 1 minuteLast updated 12 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public LOD[] GetLODs()

Returns

Type

Description

LOD[]The LOD array.

Remarks

#if UNITY_EDITORusing UnityEditor;#endifusing UnityEngine;[ExecuteInEditMode]public class DisplayLods : MonoBehaviour{#if UNITY_EDITOR void OnGUI() { // Display on the Game view top level information of each LOD for the selected LODGroup. if (gameObject != Selection.activeGameObject) return; var lodGroup = GetComponent<LODGroup>(); if (lodGroup && gameObject == Selection.activeGameObject) { LOD[] lods = lodGroup.GetLODs(); GUILayout.BeginVertical(gameObject.name); for (int i=0 ; i<lods.Length ; i++) { LOD lod = lods[i]; GUILayout.Label($"LOD {i} : Renderer count = {lod.renderers.Length}, Fade trans. width = {lod.fadeTransitionWidth}, Screen rel. trans. height = {lod.screenRelativeTransitionHeight}"); } GUILayout.EndVertical(); } }#endif}
Additional Resources: LOD, LODGroup.SetLODs