using System; using System.Collections; using System.Collections.Generic; using…
- User
using System; using System.Collections; using System.Collections.Generic; using UnityEngine;
public class gizmoSample03 : MonoBehaviour { public Mesh mesh;
code// Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } void OnDrawGizmos() { if(mesh !=null) { Gizmos.color = Color.green; for(int i = 0; i < mesh.subMeshCount; i++) { int[] triangles = mesh.GetTriangles(i); for(int j = 0; j<triangles.Length; j+=3) { Gizmos.DrawRay(mesh.vertices[triangles[j]], mesh.vertices[triangles[j+1]] - mesh.vertices[triangles[j]] ); Gizmos.DrawRay(mesh.vertices[triangles[j+1]], mesh.vertices[triangles[j+2]] - mesh.vertices[triangles[j+1]] ); Gizmos.DrawRay(mesh.vertices[triangles[j+2]], mesh.vertices[triangles[j]] - mesh.vertices[triangles[j+2]] ); } } } }}
- Assistant