-
-
Save kirillrybin/6726901 to your computer and use it in GitHub Desktop.
Отображение нормалей вершин
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class NormalsDrawer : MonoBehaviour | |
{ | |
private Mesh _mesh; | |
void OnDrawGizmosSelected() | |
{ | |
_mesh = GetComponent<MeshFilter>().mesh; | |
for (var i = 0; i < _mesh.vertices.Length; i++) | |
{ | |
var vertice = _mesh.vertices[i]; | |
Debug.DrawRay(transform.position + vertice, vertice.normalized * 0.1F, Color.green); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment