Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetColors

Gets the vertex colors of the Mesh.
Read time 1 minuteLast updated 6 days ago

Definition

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

GetColors(List<Color>)

Gets the vertex colors of the Mesh.
public void GetColors(List<Color> colors)

Parameters

A list of vertex colors to populate.

Remarks

The color at each index corresponds to the vertex with the same index.
Use this method instead of Mesh.colors or Mesh.colors32 if you control the life cycle of the list passed in and you want to avoid allocating a new array with every access.
Additional Resources: Mesh.AcquireReadOnlyMeshData function.

GetColors(List<Color32>)

Gets the vertex colors of the Mesh.
public void GetColors(List<Color32> colors)

Parameters

A list of vertex colors to populate.

Remarks

The color at each index corresponds to the vertex with the same index.
Use this method instead of Mesh.colors or Mesh.colors32 if you control the life cycle of the list passed in and you want to avoid allocating a new array with every access.
Additional Resources: Mesh.AcquireReadOnlyMeshData function.