LODGroup
LODGroup lets you group multiple Renderers into LOD levels.
Read time 6 minutesLast updated 5 days ago
Definition
- Type: Class
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
- Inherits from: Component
public class LODGroup : Component
Remarks
This can be used to switch between different LOD levels at runtime based on size on screen.
Properties
Property | Description |
|---|---|
| animateCrossFading | Specify if the cross-fading should be animated by time. The animation duration is specified globally as LODGroup.crossFadeAnimationDuration. |
| enabled | Allows you to enable or disable the LODGroup. |
| fadeMode | The LOD fade mode used. |
| lastLODBillboard | Specify whether the last LOD level is a BillboardRenderer. |
| localReferencePoint | The local reference point against which the LOD distance is calculated. |
| lodCount | The number of LOD levels. |
| size | The size of the LOD object in local space. |
Static Properties
Property | Description |
|---|---|
| crossFadeAnimationDuration | The cross-fading animation duration in seconds. ArgumentException will be thrown if it is set to zero or a negative value. |
Methods
Method | Description |
|---|---|
| ForceLOD | Disable automatic LOD selection based on camera distance by forcing a specific LOD level, or revert to the default automatic behavior by passing a negative value as parameter. |
| GetLODs | Returns the array of LODs. |
| RecalculateBounds | Recalculate the bounding region for the LODGroup. This process can be slow. To avoid lag, call this function infrequently. |
| SetLODs | Set the LODs for the LOD group. This removes any existing LODs configured on the LODGroup. |
Inheritance
Operators
Operator | Description |
|---|---|
| operator == | Compares two object references to see if they refer to the same object. |
| bool | Determines whether the object exists. |
| operator != | Compares if two objects refer to a different object. |