void Gizmo() { Handles.color = Color.green; int[] triangles = myMeshCreator.GetMesh().triangles; Vector3[] vertices = myMeshCreator.GetMesh().vertices; int[] outLineVertices = myMeshCreator.GetOutLineVertice().ToArray(); // tri 배열을 순환하면서 얻은 데이터로 vertices를 순환. for (int i = 0; i < myMeshCreator.GetMesh().triangles.Length; ++i) { if (i % 3 == 0) { Handles.DrawLine( vertices[triangles[i]] + myMeshCreator.transform.position, vertices[triangles[i + 2]] + myMeshCreator.transform.position ); continue; } Handles.DrawLine( myMeshCreator.GetMesh().vertices[myMeshCreator.GetMesh().triangles[i - 1]] + myMeshCreator.transform.position, myMeshCreator.GetMesh().vertices[myMeshCreator.GetMesh().triangles[i]] + myMeshCreator.transform.position ); } Handles.color = Color.red; // OutLine을 그림. for (int i = 1; i < outLineVertices.Length; ++i) { for (int j = 0; j < 2; ++j) { Handles.DrawLine( vertices[outLineVertices[i - 1]] + myMeshCreator.transform.position, vertices[outLineVertices[i]] + myMeshCreator.transform.position); } } }