言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

Mesh.vertices

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public var vertices: Vector3[];
public Vector3[] vertices;
public vertices as Vector3[]

Description

頂点の位置、または新しい頂点の位置の配列

The number of vertices in the mesh is changed by assigning a vertex array with a different number of vertices. Note that if you resize the vertex array then all other vertex attributes (normals, colors, tangents, UVs) will be automatically resized too. RecalculateBounds will automatically be invoked if no vertices have been assigned to the mesh when setting the vertices.

	function Update () {
		var mesh : Mesh = GetComponent(MeshFilter).mesh;
		var vertices : Vector3[] = mesh.vertices;

		for (var i = 0; i < vertices.Length; i++)
			vertices[i] += Vector3.up * Time.deltaTime;

		mesh.vertices = vertices;
		mesh.RecalculateBounds();
	}
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    void Update() {
        Mesh mesh = GetComponent<MeshFilter>().mesh;
        Vector3[] vertices = mesh.vertices;
        int i = 0;
        while (i < vertices.Length) {
            vertices[i] += Vector3.up * Time.deltaTime;
            i++;
        }
        mesh.vertices = vertices;
        mesh.RecalculateBounds();
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	def Update() as void:
		mesh as Mesh = GetComponent[of MeshFilter]().mesh
		vertices as (Vector3) = mesh.vertices
		i as int = 0
		while i < vertices.Length:
			vertices[i] += (Vector3.up * Time.deltaTime)
			i++
		mesh.vertices = vertices
		mesh.RecalculateBounds()