docs.unity.cn
    Show / Hide Table of Contents

    Class SceneObjectReference

    Used to reference different Unity Objects.

    Inheritance
    Object
    SceneObjectReference
    Namespace: Unity.Tutorials.Core.Editor
    Syntax
    public class SceneObjectReference : object

    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

    Properties

    IsAssetReference

    Is this an Asset reference.

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

    IsComponentReference

    Is this a Component reference.

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

    IsGameObjectReference

    Is this a GameObject reference.

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

    IsPrefabReference

    Is this a Prefab reference.

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

    ReferencedObject

    The referenced Object.

    Declaration
    public UnityEngine.Object ReferencedObject { get; }
    Property Value
    Type Description
    UnityEngine.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

    ReferenceResolved

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

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

    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

    Methods

    Update(UnityEngine.Object)

    Resets/updates this reference to a new object.

    Declaration
    public void Update(UnityEngine.Object newObject)
    Parameters
    Type Name Description
    UnityEngine.Object newObject
    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX
    on Thursday, July 8, 2021