# GetUVs

> Populates an array with the UVs from the MeshData.

## Definition

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

## GetUVs(int, NativeArray\<Vector2>)

Populates an array with the UVs from the `MeshData`.

```csharp
public void GetUVs(int channel, NativeArray<Vector2> outUVs)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The UV channel, in \[0..7] range.**** (\[NativeArray\<Vector2>]\(/engine/6000.7/script-reference/unity/collections/nativearray1)): The destination texture coordinates array.

### Remarks

The destination array must have at least [vertexCount](/engine/6000.7/script-reference/unityengine/mesh/meshdata/vertexcount.md) elements. The UV at each index corresponds to the vertex with the same index. Texture coordinate data will be converted into [Vector2](/engine/6000.7/script-reference/unityengine/vector2.md), [Vector3](/engine/6000.7/script-reference/unityengine/vector3.md) or [Vector4](/engine/6000.7/script-reference/unityengine/vector4.md) format as needed. Additional Resources: [Mesh.GetUVs](/engine/6000.7/script-reference/unityengine/mesh/getuvs.md), [HasVertexAttribute](/engine/6000.7/script-reference/unityengine/mesh/meshdata/hasvertexattribute.md), [Mesh.AcquireReadOnlyMeshData](/engine/6000.7/script-reference/unityengine/mesh/acquirereadonlymeshdata.md).

## GetUVs(int, NativeArray\<Vector3>)

Populates an array with the UVs from the `MeshData`.

```csharp
public void GetUVs(int channel, NativeArray<Vector3> outUVs)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The UV channel, in \[0..7] range.**** (\[NativeArray\<Vector3>]\(/engine/6000.7/script-reference/unity/collections/nativearray1)): The destination texture coordinates array.

### Remarks

The destination array must have at least [vertexCount](/engine/6000.7/script-reference/unityengine/mesh/meshdata/vertexcount.md) elements. The UV at each index corresponds to the vertex with the same index. Texture coordinate data will be converted into [Vector2](/engine/6000.7/script-reference/unityengine/vector2.md), [Vector3](/engine/6000.7/script-reference/unityengine/vector3.md) or [Vector4](/engine/6000.7/script-reference/unityengine/vector4.md) format as needed. Additional Resources: [Mesh.GetUVs](/engine/6000.7/script-reference/unityengine/mesh/getuvs.md), [HasVertexAttribute](/engine/6000.7/script-reference/unityengine/mesh/meshdata/hasvertexattribute.md), [Mesh.AcquireReadOnlyMeshData](/engine/6000.7/script-reference/unityengine/mesh/acquirereadonlymeshdata.md).

## GetUVs(int, NativeArray\<Vector4>)

Populates an array with the UVs from the `MeshData`.

```csharp
public void GetUVs(int channel, NativeArray<Vector4> outUVs)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The UV channel, in \[0..7] range.**** (\[NativeArray\<Vector4>]\(/engine/6000.7/script-reference/unity/collections/nativearray1)): The destination texture coordinates array.

### Remarks

The destination array must have at least [vertexCount](/engine/6000.7/script-reference/unityengine/mesh/meshdata/vertexcount.md) elements. The UV at each index corresponds to the vertex with the same index. Texture coordinate data will be converted into [Vector2](/engine/6000.7/script-reference/unityengine/vector2.md), [Vector3](/engine/6000.7/script-reference/unityengine/vector3.md) or [Vector4](/engine/6000.7/script-reference/unityengine/vector4.md) format as needed. Additional Resources: [Mesh.GetUVs](/engine/6000.7/script-reference/unityengine/mesh/getuvs.md), [HasVertexAttribute](/engine/6000.7/script-reference/unityengine/mesh/meshdata/hasvertexattribute.md), [Mesh.AcquireReadOnlyMeshData](/engine/6000.7/script-reference/unityengine/mesh/acquirereadonlymeshdata.md).
