Class ShapeFactory
Provides methods to instantiate GameObjects in the Editor using ProBuilder shapes.
Inherited Members
Namespace: UnityEngine.ProBuilder
Assembly: Unity.ProBuilder.dll
Syntax
public static class ShapeFactory
Methods
Instantiate(Type, PivotLocation)
Creates a specific shape with default parameters.
Declaration
public static ProBuilderMesh Instantiate(Type shapeType, PivotLocation pivotType = PivotLocation.Center)
Parameters
Type | Name | Description |
---|---|---|
Type | shapeType | The ShapeType to create. |
PivotLocation | pivotType | By default, new shapes pivot around the center of the bounding box but you can specify FirstCorner instead. |
Returns
Type | Description |
---|---|
ProBuilderMesh | A new GameObject with the ProBuilderMesh initialized to the specified primitive ShapeType. |
Instantiate(Shape, PivotLocation)
Creates a specific shape with default parameters.
Declaration
public static ProBuilderMesh Instantiate(Shape shape, PivotLocation pivotType = PivotLocation.Center)
Parameters
Type | Name | Description |
---|---|---|
Shape | shape | The Shape to create. |
PivotLocation | pivotType | By default, new shapes pivot around the center of the bounding box but you can specify FirstCorner instead. |
Returns
Type | Description |
---|---|
ProBuilderMesh | A new GameObject with the ProBuilderMesh initialized to the primitive Shape. |
Instantiate<T>(PivotLocation)
Creates a default shape with default parameters.
Declaration
public static ProBuilderMesh Instantiate<T>(PivotLocation pivotType = PivotLocation.Center) where T : Shape, new()
Parameters
Type | Name | Description |
---|---|---|
PivotLocation | pivotType | By default, new shapes pivot around the center of the bounding box but you can specify FirstCorner instead. |
Returns
Type | Description |
---|---|
ProBuilderMesh | A new GameObject with the ProBuilderMesh initialized to the default primitive shape. |
Type Parameters
Name | Description |
---|---|
T | The Shape to instantiate |