docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ObjectCreationData

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

    Inheritance
    object
    Object
    ScriptableObject
    ObjectCreationData
    BodyObjectCreationData
    GenericPrefabObjectCreationData
    SyntheticBodyObjectCreationData
    Inherited Members
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.InstantiateAsync<T>(T)
    Object.InstantiateAsync<T>(T, Transform)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int)
    Object.InstantiateAsync<T>(T, int, Transform)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, CancellationToken)
    Object.InstantiateAsync<T>(T, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, InstantiateParameters, CancellationToken)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Scene)
    Object.Instantiate<T>(T, InstantiateParameters)
    Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEditor.MARS
    Assembly: Unity.MARS.Editor.dll
    Syntax
    [Serializable]
    [MovedFrom("Unity.MARS")]
    public abstract class ObjectCreationData : ScriptableObject

    Fields

    m_Icon

    Icon used for the object creation button

    Declaration
    [SerializeField]
    [Tooltip("Icon used for the object creation button")]
    protected DarkLightIconPair m_Icon
    Field Value
    Type Description
    DarkLightIconPair

    m_ObjectName

    Name of the object being created

    Declaration
    [FormerlySerializedAs("m_ButtonName")]
    [SerializeField]
    [Tooltip("Name of the object being created")]
    protected string m_ObjectName
    Field Value
    Type Description
    string

    m_Tooltip

    Tooltip for the object creation button

    Declaration
    [SerializeField]
    [Tooltip("Tooltip for the object creation button")]
    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
    [Obsolete("CreateGameObject() has been deprecated. Use CreateGameObject(out GameObject createdObj, Transform parentTransform) instead.", false)]
    public virtual bool CreateGameObject()
    Returns
    Type Description
    bool

    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
    bool

    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

    In This Article
    Back to top
    Copyright © 2025 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)