docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ShapeFactory

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

    Inheritance
    object
    ShapeFactory
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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 PivotLocation.FirstCorner instead.

    Returns
    Type Description
    ProBuilderMesh

    A new GameObject with the ProBuilderMesh initialized to the specified primitive ShapeType.

    Instantiate(Shape)

    Creates a specific shape with default parameters.

    Declaration
    public static ProBuilderMesh Instantiate(Shape shape)
    Parameters
    Type Name Description
    Shape shape

    The Shape to create.

    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 PivotLocation.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

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)