Mesh.uv2 Manual     Reference     Scripting  
Scripting > Runtime Classes > Mesh
Mesh.uv2

var uv2 : Vector2[]

Description

The second texture coordinate set of the mesh, if present.

// Generate planar uv coordinates for the secondary uv set
function Start () {
var mesh : Mesh = GetComponent(MeshFilter).mesh;
var vertices = mesh.vertices;
var uvs = new Vector2[vertices.length];

for (var i=0;i<uvs.Length;i++) {
uvs[i] = Vector2 (vertices[i].x, vertices[i].z);
}
mesh.uv2 = uvs;
}