# SetAllIndices

> Fills the values of the allocated indices with values copied directly from an array. Each 3 consecutive indices form a single triangle.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.UIElements](/engine/6000.0/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

## SetAllIndices(ushort\[])

Fills the values of the allocated indices with values copied directly from an array. Each 3 consecutive indices form a single triangle.

```csharp
public void SetAllIndices(ushort[] indices)
```

### Parameters

**** (\[ushort\[]]\(https\://learn.microsoft.com/dotnet/api/system.uint16)): The array of indices to copy from. The length of the array must match the allocated index count.

### Remarks

When this method is called, it is not possible to use [MeshWriteData.SetNextIndex](/engine/6000.0/script-reference/unityengine/uielements/meshwritedata/setnextindex.md) to fill the indices.

## SetAllIndices(NativeSlice\<ushort>)

Fills the values of the allocated indices with values copied directly from an array. Each 3 consecutive indices form a single triangle.

```csharp
public void SetAllIndices(NativeSlice<ushort> indices)
```

### Parameters

**** (\[NativeSlice\<ushort>]\(/engine/6000.0/script-reference/unity/collections/nativeslice1)): The array of indices to copy from. The length of the array must match the allocated index count.

### Remarks

When this method is called, it is not possible to use [MeshWriteData.SetNextIndex](/engine/6000.0/script-reference/unityengine/uielements/meshwritedata/setnextindex.md) to fill the indices.
