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 Shape |
Pivot |
pivotType | By default, new shapes pivot around the center of the bounding box but you can specify PivotLocation.FirstCorner instead. |
Returns
Type | Description |
---|---|
Pro |
A new GameObject with the ProBuilderMesh initialized to the specified primitive Shape |
Instantiate(Shape)
Creates a specific shape with default parameters.
Declaration
public static ProBuilderMesh Instantiate(Shape shape)
Parameters
Returns
Type | Description |
---|---|
Pro |
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 |
---|---|---|
Pivot |
pivotType | By default, new shapes pivot around the center of the bounding box but you can specify PivotLocation.FirstCorner instead. |
Returns
Type | Description |
---|---|
Pro |
A new GameObject with the ProBuilderMesh initialized to the default primitive shape. |
Type Parameters
Name | Description |
---|---|
T | The Shape to instantiate |