public GetVertices ( IList indexes = null ) : UnityEngine.ProBuilder.Vertex[] | ||
indexes | IList | An optional list of indexes pointing to the mesh attribute indexes to include in the returned Vertex array. |
return | UnityEngine.ProBuilder.Vertex[] |
public static void Apply( IEnumerable <FaceRebuildData> newFaces, ProBuilderMesh mesh, List <Vertex> vertices = null, List <Face> faces = null) { if (faces == null) { faces = new List <Face>(mesh.facesInternal); } if (vertices == null) { vertices = new List <Vertex>(mesh.GetVertices()); } var lookup = mesh.sharedVertexLookup; var lookupUV = mesh.sharedTextureLookup; Apply(newFaces, vertices, faces, lookup, lookupUV); mesh.SetVertices(vertices); mesh.faces = faces; mesh.SetSharedVertices(lookup); mesh.SetSharedTextures(lookupUV); }
/// <summary> /// Set a collection of mesh attributes with a Vertex. /// <br /><br /> /// Use @"UnityEngine.ProBuilder.ProBuilderMesh.sharedIndexes" and IntArrayUtility.IndexOf to get a shared (or common) index. /// </summary> /// <param name="mesh"></param> /// <param name="sharedVertexHandle"></param> /// <param name="vertex"></param> internal static void SetSharedVertexValues(this ProBuilderMesh mesh, int sharedVertexHandle, Vertex vertex) { Vertex[] vertices = mesh.GetVertices(); foreach (var index in mesh.sharedVerticesInternal[sharedVertexHandle]) { vertices[index] = vertex; } mesh.SetVertices(vertices); }
internal static string SanityCheck(ProBuilderMesh mesh) { return(SanityCheck(mesh.GetVertices())); }