Version: 5.3 (switch to 5.4b)
IdiomaEnglish
  • C#
  • JS

Idioma de script

Selecciona tu lenguaje de programación favorito. Todos los fragmentos de código serán mostrados en este lenguaje.

Mesh.uv4

Cambiar al Manual
public Vector2[] uv4;

Descripción

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

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void Start() { Mesh mesh = GetComponent<MeshFilter>().mesh; Vector3[] vertices = mesh.vertices; Vector2[] uvs = new Vector2[vertices.Length]; int i = 0; while (i < uvs.Length) { uvs[i] = new Vector2(vertices[i].x, vertices[i].z); i++; } mesh.uv2 = uvs; mesh.uv3 = uvs; mesh.uv4 = uvs; } }