public SetVertices ( IList vertices, bool applyMesh = false ) : void | ||
vertices | IList | The new vertex array. |
applyMesh | bool | An optional parameter that will apply elements to the MeshFilter.sharedMesh. Note that this should only be used when the mesh is in its original state, not optimized (meaning it won't affect triangles which can be modified by Optimize). |
리턴 | void |
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); }