错误写法(画不出来):
void OnDrawGizmos(){
Mesh mesh=new Mesh();
mesh.vertices=...
mesh.triangles=...
//mesh.RecalculateBounds()
Gizmos.DrawMesh(mesh);
}
正确写法1:
void OnDrawGizmos(){
Mesh mesh=new Mesh();
mesh.vertices=...
mesh.triangles=...
mesh.normals=...
//mesh.RecalculateBounds()
Gizmos.DrawMesh(mesh);
}
正确写法2:
void OnDrawGizmos(){
Mesh mesh=new Mesh();
mesh.vertices=...
mesh.triangles=...
mesh.RecalculateNormals ();
//mesh.RecalculateBounds()
Gizmos.DrawMesh(mesh);
}