docs.unity3d.com
    Show / Hide Table of Contents

    Class ShapeFactory

    Provides methods to instantiate GameObjects in the Editor using ProBuilder shapes.

    Inheritance
    Object
    ShapeFactory
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEngine.ProBuilder
    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

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023