Class ExtrudeElements
Contains functions to help with face and edge extrusion.
Inherited Members
Namespace: UnityEngine.ProBuilder.MeshOperations
Syntax
public static class ExtrudeElements
Methods
DetachFaces(ProBuilderMesh, IEnumerable<Face>)
Splits any shared vertices so that this face may be moved independently of the GameObject.
This is the equivalent of the Detach Faces action.
Declaration
public static List<Face> DetachFaces(this ProBuilderMesh mesh, IEnumerable<Face> faces)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The source mesh. |
System.Collections.Generic.IEnumerable<Face> | faces | The faces to split from the mesh. |
Returns
Type | Description |
---|---|
List<Face> | The faces created forming the detached face group. |
DetachFaces(ProBuilderMesh, IEnumerable<Face>, Boolean)
Splits any shared vertices so that this face may be moved independently of the GameObject and optionally deletes the faces on the source geometry.
This is the equivalent of the Detach Faces action.
Declaration
public static List<Face> DetachFaces(this ProBuilderMesh mesh, IEnumerable<Face> faces, bool deleteSourceFaces)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The source mesh. |
System.Collections.Generic.IEnumerable<Face> | faces | The faces to split from the mesh. |
Boolean | deleteSourceFaces | True to delete the faces on the source geometry where the faces were detached; false to keep them. |
Returns
Type | Description |
---|---|
List<Face> | The faces created forming the detached face group. |
Extrude(ProBuilderMesh, IEnumerable<Edge>, Single, Boolean, Boolean)
Extrudes a collection of edges.
This is the equivalent of the Extrude Edges action.
Declaration
public static Edge[] Extrude(this ProBuilderMesh mesh, IEnumerable<Edge> edges, float distance, bool extrudeAsGroup, bool enableManifoldExtrude)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The source mesh. |
System.Collections.Generic.IEnumerable<Edge> | edges | The edges to extrude. |
Single | distance | The distance to extrude. |
Boolean | extrudeAsGroup | True to keep any shared vertices when extruding adjacent edges; false to split the shared vertex. |
Boolean | enableManifoldExtrude | True to allow this function to extrude manifold edges; false to disallow. |
Returns
Type | Description |
---|---|
Edge[] | The extruded edges, or null if the action failed due to manifold check or an empty edges parameter. |
Extrude(ProBuilderMesh, IEnumerable<Face>, ExtrudeMethod, Single)
Extrudes a collection of faces.
This is the equivalent of the Extrude Faces action.
Declaration
public static Face[] Extrude(this ProBuilderMesh mesh, IEnumerable<Face> faces, ExtrudeMethod method, float distance)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The source mesh. |
System.Collections.Generic.IEnumerable<Face> | faces | The faces to extrude. |
ExtrudeMethod | method | Describes how to extrude the faces (separately or as a group, either from averaged or individual normals). |
Single | distance | The distance to extrude faces. |
Returns
Type | Description |
---|---|
Face[] | An array of the faces created as a result of the extrusion or null if |