# SetLods

> Sets the Mesh LOD ranges (index start and index count) for a given sub-mesh and Mesh LOD with a list.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.3/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

## SetLods(List\<MeshLodRange>, int, MeshUpdateFlags)

Sets the Mesh LOD ranges (index start and index count) for a given sub-mesh and Mesh LOD with a list.

```csharp
public void SetLods(List<MeshLodRange> levels, int submesh, MeshUpdateFlags flags = MeshUpdateFlags.Default)
```

### Parameters

**** (\[List\<MeshLodRange>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Sub-mesh index to set LODs for.**** (\[MeshUpdateFlags]\(/engine/6000.3/script-reference/unityengine/rendering/meshupdateflags)): Mesh update flags.  If set to DontValidateIndices, then index range validation is skipped.

### Remarks

Note that each Mesh LOD range should be relative to the sub-mesh holding the LOD. See [MeshLodRange](/engine/6000.3/script-reference/unityengine/meshlodrange.md) for more information.

## SetLods(List\<MeshLodRange>, int, int, int, MeshUpdateFlags)

Sets the Mesh LOD ranges (index start and index count) for a given sub-mesh and Mesh LOD with a list.

```csharp
public void SetLods(List<MeshLodRange> levels, int start, int count, int submesh, MeshUpdateFlags flags = MeshUpdateFlags.Default)
```

### Parameters

**** (\[List\<MeshLodRange>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Starting index in the array.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Count of elements in array.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Sub-mesh index to set LODs for.**** (\[MeshUpdateFlags]\(/engine/6000.3/script-reference/unityengine/rendering/meshupdateflags)): Mesh update flags.  If set to DontValidateIndices, then index range validation is skipped.

### Remarks

Note that each Mesh LOD range should be relative to the sub-mesh holding the LOD. See [MeshLodRange](/engine/6000.3/script-reference/unityengine/meshlodrange.md) for more information.

## SetLods(MeshLodRange\[], int, MeshUpdateFlags)

Sets the Mesh LOD ranges (index start and index count) for a given sub-mesh with an array.

```csharp
public void SetLods(MeshLodRange[] levels, int submesh, MeshUpdateFlags flags = MeshUpdateFlags.Default)
```

### Parameters

**** (\[MeshLodRange\[]]\(/engine/6000.3/script-reference/unityengine/meshlodrange)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The sub-mesh index to set LODS for.**** (\[MeshUpdateFlags]\(/engine/6000.3/script-reference/unityengine/rendering/meshupdateflags)): Mesh update flags. If set to DontValidateIndices, then index range validation is skipped.

### Remarks

Note that each Mesh LOD range should be relative to the sub-mesh holding the LOD. See [MeshLodRange](/engine/6000.3/script-reference/unityengine/meshlodrange.md) for more information.

## SetLods(MeshLodRange\[], int, int, int, MeshUpdateFlags)

Sets the Mesh LOD ranges (index start and index count) for a given sub-mesh with an array.

```csharp
public void SetLods(MeshLodRange[] levels, int start, int count, int submesh, MeshUpdateFlags flags = MeshUpdateFlags.Default)
```

### Parameters

**** (\[MeshLodRange\[]]\(/engine/6000.3/script-reference/unityengine/meshlodrange)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Starting index in the array.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Count of elements in array.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The sub-mesh index to set LODS for.**** (\[MeshUpdateFlags]\(/engine/6000.3/script-reference/unityengine/rendering/meshupdateflags)): Mesh update flags. If set to DontValidateIndices, then index range validation is skipped.

### Remarks

Note that each Mesh LOD range should be relative to the sub-mesh holding the LOD. See [MeshLodRange](/engine/6000.3/script-reference/unityengine/meshlodrange.md) for more information.

## SetLods(NativeArray\<MeshLodRange>, int, MeshUpdateFlags)

Set a LOD ranges for a given submesh with a NativeArray.

```csharp
public void SetLods(NativeArray<MeshLodRange> levels, int submesh, MeshUpdateFlags flags = MeshUpdateFlags.Default)
```

### Parameters

**** (\[NativeArray\<MeshLodRange>]\(/engine/6000.3/script-reference/unity/collections/nativearray1)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Sub-mesh index to set LODs for.**** (\[MeshUpdateFlags]\(/engine/6000.3/script-reference/unityengine/rendering/meshupdateflags)): Mesh update flags.  If set to DontValidateIndices, then index range validation is skipped.

### Remarks

Note that each Mesh LOD range should be relative to the sub-mesh holding the LOD. See [MeshLodRange](/engine/6000.3/script-reference/unityengine/meshlodrange.md) for more information.

## SetLods(NativeArray\<MeshLodRange>, int, int, int, MeshUpdateFlags)

Set a LOD ranges for a given submesh with a NativeArray.

```csharp
public void SetLods(NativeArray<MeshLodRange> levels, int start, int count, int submesh, MeshUpdateFlags flags = MeshUpdateFlags.Default)
```

### Parameters

**** (\[NativeArray\<MeshLodRange>]\(/engine/6000.3/script-reference/unity/collections/nativearray1)): **** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Starting index in the array.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Count of elements in array.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Sub-mesh index to set LODs for.**** (\[MeshUpdateFlags]\(/engine/6000.3/script-reference/unityengine/rendering/meshupdateflags)): Mesh update flags.  If set to DontValidateIndices, then index range validation is skipped.

### Remarks

Note that each Mesh LOD range should be relative to the sub-mesh holding the LOD. See [MeshLodRange](/engine/6000.3/script-reference/unityengine/meshlodrange.md) for more information.
