docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SceneObjectReference

    Used to reference different Unity Objects.

    Inheritance
    object
    SceneObjectReference
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Tutorials.Core.Editor
    Assembly: Unity.Tutorials.Core.Editor.dll
    Syntax
    [Serializable]
    public class SceneObjectReference

    Constructors

    SceneObjectReference()

    Default constructs this class to uninitialized state.

    Declaration
    public SceneObjectReference()

    SceneObjectReference(SerializedProperty)

    Constructs from a SerializedProperty.

    Declaration
    public SceneObjectReference(SerializedProperty property)
    Parameters
    Type Name Description
    SerializedProperty property

    The SerializedProperty parent of that SceneObjectReference

    Properties

    IsAssetReference

    Is this an Asset reference.

    Declaration
    public bool IsAssetReference { get; }
    Property Value
    Type Description
    bool

    IsComponentReference

    Is this a Component reference.

    Declaration
    public bool IsComponentReference { get; }
    Property Value
    Type Description
    bool

    IsGameObjectReference

    Is this a GameObject reference.

    Declaration
    public bool IsGameObjectReference { get; }
    Property Value
    Type Description
    bool

    IsPrefabReference

    Is this a Prefab reference.

    Declaration
    public bool IsPrefabReference { get; }
    Property Value
    Type Description
    bool

    ReferenceResolved

    Is the reference resolved, that is, pointing to a valid object.

    Declaration
    public bool ReferenceResolved { get; }
    Property Value
    Type Description
    bool

    ReferenceScene

    The Scene the referenced GameObject/Component belongs to, if this is a GameObject/Component reference.

    Declaration
    public SceneAsset ReferenceScene { get; }
    Property Value
    Type Description
    SceneAsset

    ReferencedObject

    The referenced Object.

    Declaration
    public Object ReferencedObject { get; }
    Property Value
    Type Description
    Object

    ReferencedObjectAsComponent

    The referenced Object as Component.

    Declaration
    public Component ReferencedObjectAsComponent { get; }
    Property Value
    Type Description
    Component

    ReferencedObjectAsGameObject

    The referenced Object as GameObject.

    Declaration
    public GameObject ReferencedObjectAsGameObject { get; }
    Property Value
    Type Description
    GameObject

    Methods

    Update(Object)

    Resets/updates this reference to a new object.

    Declaration
    public void Update(Object newObject)
    Parameters
    Type Name Description
    Object newObject

    The Object to use to reset/update that SceneObjectReference to

    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)