Class SceneObject
Base class for objects that are parts of the scene (actors and scripts).
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public abstract class SceneObject : Object, ISerializable
Constructors
SceneObject()
Properties
HasParent
Returns true if object has a parent assigned.
Declaration
[Unmanaged]
public bool HasParent { get; }
Property Value
System.Boolean
|
HasPrefabLink
Gets a value indicating whether this object has a valid linkage to the prefab asset.
Declaration
[Unmanaged]
public bool HasPrefabLink { get; }
Property Value
System.Boolean
|
IsDuringPlay
Determines whether object is during play (spawned/loaded and fully initialized).
Declaration
[Unmanaged]
public bool IsDuringPlay { get; }
Property Value
System.Boolean
|
PrefabID
Gets the prefab asset ID. Empty if no prefab link exists.
Declaration
[Unmanaged]
public Guid PrefabID { get; }
Property Value
System.Guid
|
PrefabObjectID
Gets the ID of the object within a prefab that is used for synchronization with this object. Empty if no prefab link exists.
Declaration
[Unmanaged]
public Guid PrefabObjectID { get; }
Property Value
System.Guid
|
Methods
BreakPrefabLink()
Breaks the prefab linkage for this object, all its scripts, and all child actors.
Declaration
[NoAnimate]
[Unmanaged]
public virtual void BreakPrefabLink()
GetNamePath(Char)
Gets the path containing name of this object and all parent objects in tree hierarchy separated with custom separator character (/ by default). Can be used to identify this object in logs.
Declaration
[Unmanaged]
public string GetNamePath(char separatorChar = '/')
Parameters
System.Char
separatorChar
The character to separate the names. |
Returns
System.String
The full name path. |
LinkPrefab(Guid, Guid)
Links scene object instance to the prefab asset and prefab object. Warning! This applies to the only this object (not scripts or child actors).
Declaration
[NoAnimate]
[Unmanaged]
public virtual void LinkPrefab(Guid prefabId, Guid prefabObjectId)
Parameters
System.Guid
prefabId
The prefab asset identifier. |
System.Guid
prefabObjectId
The prefab object identifier. |
SetParent(Actor, Boolean)
Sets the parent actor.
Declaration
[Unmanaged]
public virtual void SetParent(Actor value, bool canBreakPrefabLink)
Parameters
Actor
value
The new parent. |
System.Boolean
canBreakPrefabLink
True if can break prefab link on changing the parent. |