Method GetArrays
GetArrays(IList<Vertex>, out Vector3[], out Color[], out Vector2[], out Vector3[], out Vector4[], out Vector2[], out List<Vector4>, out List<Vector4>)
Allocates and fills all attribute arrays. This method fills all arrays, regardless of whether or not
real data populates the values. You can check which attributes a Vertex contains with HasAttribute()
).
Declaration
public static void GetArrays(IList<Vertex> vertices, out Vector3[] position, out Color[] color, out Vector2[] uv0, out Vector3[] normal, out Vector4[] tangent, out Vector2[] uv2, out List<Vector4> uv3, out List<Vector4> uv4)
Parameters
Type | Name | Description |
---|---|---|
IList<Vertex> | vertices | The source vertices. |
Vector3[] | position | A new array of the vertex position values. |
Color[] | color | A new array of the vertex color values. |
Vector2[] | uv0 | A new array of the vertex uv0 values. |
Vector3[] | normal | A new array of the vertex normal values. |
Vector4[] | tangent | A new array of the vertex tangent values. |
Vector2[] | uv2 | A new array of the vertex uv2 values. |
List<Vector4> | uv3 | A new array of the vertex uv3 values. |
List<Vector4> | uv4 | A new array of the vertex uv4 values. |
Remarks
If you are using this function to rebuild a mesh, use SetMesh(Mesh, IList<Vertex>) instead. SetMesh handles setting null arrays where appropriate.
GetArrays(IList<Vertex>, out Vector3[], out Color[], out Vector2[], out Vector3[], out Vector4[], out Vector2[], out List<Vector4>, out List<Vector4>, MeshArrays)
Allocates and fills the specified attribute arrays.
Declaration
public static void GetArrays(IList<Vertex> vertices, out Vector3[] position, out Color[] color, out Vector2[] uv0, out Vector3[] normal, out Vector4[] tangent, out Vector2[] uv2, out List<Vector4> uv3, out List<Vector4> uv4, MeshArrays attributes)
Parameters
Type | Name | Description |
---|---|---|
IList<Vertex> | vertices | The source vertices. |
Vector3[] | position | A new array of the vertex position values if requested by the attributes parameter, or null. |
Color[] | color | A new array of the vertex color values if requested by the attributes parameter, or null. |
Vector2[] | uv0 | A new array of the vertex uv0 values if requested by the attributes parameter, or null. |
Vector3[] | normal | A new array of the vertex normal values if requested by the attributes parameter, or null. |
Vector4[] | tangent | A new array of the vertex tangent values if requested by the attributes parameter, or null. |
Vector2[] | uv2 | A new array of the vertex uv2 values if requested by the attributes parameter, or null. |
List<Vector4> | uv3 | A new array of the vertex uv3 values if requested by the attributes parameter, or null. |
List<Vector4> | uv4 | A new array of the vertex uv4 values if requested by the attributes parameter, or null. |
MeshArrays | attributes | A bitmask of the set of MeshAttributes you want. |
Remarks
If you are using this function to rebuild a mesh, use SetMesh(Mesh, IList<Vertex>) instead. SetMesh handles setting null arrays where appropriate.