Method Create
Create()
Creates a new GameObject with a ProBuilderMesh, MeshFilter, and MeshRenderer component but leaves the position and face information empty.
Declaration
public static ProBuilderMesh Create()
Returns
Type | Description |
---|---|
ProBuilderMesh | A reference to the new ProBuilderMesh component. |
Create(IEnumerable<Vector3>, IEnumerable<Face>)
Creates a new GameObject with a ProBuilderMesh, MeshFilter, and MeshRenderer component. Then it initializes the ProBuilderMesh with the specified sets of positions and faces.
Declaration
public static ProBuilderMesh Create(IEnumerable<Vector3> positions, IEnumerable<Face> faces)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Vector3> | positions | Vertex positions array. |
IEnumerable<Face> | faces | Faces array. |
Returns
Type | Description |
---|---|
ProBuilderMesh | A reference to the new ProBuilderMesh component. |
Create(IList<Vertex>, IList<Face>, IList<SharedVertex>, IList<SharedVertex>, IList<Material>)
Creates a new GameObject with a ProBuilderMesh, MeshFilter, and MeshRenderer component. Then it initializes the ProBuilderMesh with the specified sets of positions and faces, and if specified, coincident vertices, texture coordinates, and materials.
Declaration
public static ProBuilderMesh Create(IList<Vertex> vertices, IList<Face> faces, IList<SharedVertex> sharedVertices = null, IList<SharedVertex> sharedTextures = null, IList<Material> materials = null)
Parameters
Type | Name | Description |
---|---|---|
IList<Vertex> | vertices | Array of vertex positions to use. |
IList<Face> | faces | Array of faces to use. |
IList<SharedVertex> | sharedVertices | Optional SharedVertex array to define the coincident vertices. |
IList<SharedVertex> | sharedTextures | Optional SharedVertex array to define the coincident texture coordinates (UV0). |
IList<Material> | materials | Optional array of materials to be assigned to the MeshRenderer. |
Returns
Type | Description |
---|---|
ProBuilderMesh | A reference to the new ProBuilderMesh component. |