Class SceneObjectReference
Used to reference different Unity Objects.
Inherited Members
Namespace: Unity.Tutorials.Core.Editor
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 |
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 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 |
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(Object)
Resets/updates this reference to a new object.
Declaration
public void Update(Object newObject)
Parameters
Type | Name | Description |
---|---|---|
Object | newObject |