Version: 5.3 (switch to 5.4b)
言語English
  • C#
  • JS

スクリプト言語

好きな言語を選択してください。選択した言語でスクリプトコードが表示されます。

Mesh.normals

マニュアルに切り替える
public Vector3[] normals;

説明

メッシュの法線

メッシュに法線が含まれていない場合、空の配列が返されます。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public float speed = 100.0F; void Update() { Mesh mesh = GetComponent<MeshFilter>().mesh; Vector3[] normals = mesh.normals; Quaternion rotation = Quaternion.AngleAxis(Time.deltaTime * speed, Vector3.up); int i = 0; while (i < normals.Length) { normals[i] = rotation * normals[i]; i++; } mesh.normals = normals; } }