docs.unity3d.com
    Show / Hide Table of Contents

    Class ObjectCreationData

    Used to create a game object in the editor and with a button

    Inheritance
    Object
    ObjectCreationData
    BodyObjectCreationData
    GenericPrefabObjectCreationData
    SyntheticBodyObjectCreationData
    Namespace: UnityEditor.MARS
    Syntax
    public abstract class ObjectCreationData : ScriptableObject

    Fields

    m_Icon

    Icon used for the object creation button

    Declaration
    protected DarkLightIconPair m_Icon
    Field Value
    Type Description
    DarkLightIconPair

    m_ObjectName

    Name of the object being created

    Declaration
    protected string m_ObjectName
    Field Value
    Type Description
    String

    m_Tooltip

    Tooltip for the object creation button

    Declaration
    protected string m_Tooltip
    Field Value
    Type Description
    String

    Properties

    CreateInContextSelection

    Scene context that the object will be created in

    Declaration
    public ObjectCreationData.CreateInContext CreateInContextSelection { get; }
    Property Value
    Type Description
    ObjectCreationData.CreateInContext

    ObjectGUIContent

    Object creation button GUI content

    Declaration
    public GUIContent ObjectGUIContent { get; }
    Property Value
    Type Description
    GUIContent

    ObjectName

    Name of the object being created

    Declaration
    public string ObjectName { get; }
    Property Value
    Type Description
    String

    Methods

    CreateGameObject()

    (Obsolete) Create a game object

    Declaration
    public virtual bool CreateGameObject()
    Returns
    Type Description
    Boolean

    CreateGameObject(out GameObject, Transform)

    Create a game object from the creation data

    Declaration
    public abstract bool CreateGameObject(out GameObject createdObj, Transform parentTransform)
    Parameters
    Type Name Description
    GameObject createdObj

    Newly created game object

    Transform parentTransform

    Parent transform for the newly created game object

    Returns
    Type Description
    Boolean

    true if the object was created

    GenerateInitialGameObject(String, Transform)

    Create an empty game object with a unique name at the parent transform with world scale applied

    Declaration
    protected GameObject GenerateInitialGameObject(string objName, Transform parent)
    Parameters
    Type Name Description
    String objName

    Name of the object to apply unique version

    Transform parent

    Parent transform for the newly created game object

    Returns
    Type Description
    GameObject

    Newly created game object

    GetOrGenerateUniqueParent(String)

    Get or create a new GameObject whose Transform be used as the parent for creating objects

    Declaration
    protected static Transform GetOrGenerateUniqueParent(string transformName)
    Parameters
    Type Name Description
    String transformName

    The name to search for, or to be used for the new GameObject

    Returns
    Type Description
    Transform

    The new or existing Transform

    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