文档

Unity Engine

Unity Engine

GetColors

Populates an array with the vertex colors from the MeshData.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule

GetColors(NativeArray<Color>)

Populates an array with the vertex colors from the
MeshData
.
public void GetColors(NativeArray<Color> outColors)

Parameters

The destination vertex colors array.

Remarks

The destination array must have at least vertexCount elements. The color at each index corresponds to the vertex with the same index. Vertex color data will be converted into Color or Color32 format if needed. Additional Resources: Mesh.GetColors, HasVertexAttribute, Mesh.AcquireReadOnlyMeshData.

GetColors(NativeArray<Color32>)

Populates an array with the vertex colors from the
MeshData
.
public void GetColors(NativeArray<Color32> outColors)

Parameters

The destination vertex colors array.

Remarks

The destination array must have at least vertexCount elements. The color at each index corresponds to the vertex with the same index. Vertex color data will be converted into Color or Color32 format if needed. Additional Resources: Mesh.GetColors, HasVertexAttribute, Mesh.AcquireReadOnlyMeshData.