Class Shape
Base class for all Shape types that represent a primitive shape.
Inherited Members
Namespace: UnityEngine.ProBuilder.Shapes
Syntax
[Serializable]
public abstract class Shape
Methods
CopyShape(Shape)
Overwrites this shape's property values by copying them from the specified Shape object.
Declaration
public abstract void CopyShape(Shape shape)
Parameters
Type | Name | Description |
---|---|---|
Shape | shape | The Shape to copy property values from. |
RebuildMesh(ProBuilderMesh, Vector3, Quaternion)
Rebuilds the specified mesh using the existing property values for this shape. This includes building a list of vertices and normals for each face, applying smoothing to the faces if required, and calculating the bounds of the mesh.
Declaration
public abstract Bounds RebuildMesh(ProBuilderMesh mesh, Vector3 size, Quaternion rotation)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The mesh to rebuild. |
Vector3 | size | The position of the opposite corner of the bounding box for this shape. |
Quaternion | rotation | The rotation (orientation) to use for this mesh. |
Returns
Type | Description |
---|---|
Bounds | The bounds calculated for this shape after rebuilding it. |
UpdateBounds(ProBuilderMesh, Vector3, Quaternion, Bounds)
Allows the user to redefine the default bounding box for this shape.
Declaration
public virtual Bounds UpdateBounds(ProBuilderMesh mesh, Vector3 size, Quaternion rotation, Bounds bounds)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The mesh to find the bounds for. |
Vector3 | size | The desired size for the shape defined when using the Shape Tool. |
Quaternion | rotation | The rotation (orientation) to use for this mesh. |
Bounds | bounds | The default bounds computed for the shape. |
Returns
Type | Description |
---|---|
Bounds | The bounds from this shape's bounds property. |