Class SceneObject
Base class for objects that are parts of the scene (actors and scripts).
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Level/SceneObject.h
Syntax
public class SceneObject : public ScriptingObject, public ISerializable
Constructors
~SceneObject()
SceneObject(const SpawnParams& params)
Initializes a new instance of the SceneObject class.
Declaration
protected SceneObject(const SpawnParams& params)
Parameters
SpawnParams
params
The object initialization parameters. |
Fields
_parent
_prefabID
_prefabObjectID
Methods
BeginPlay(SceneBeginData* data)
Called when adding object to the game.
Declaration
public virtual void BeginPlay(SceneBeginData* data) = 0
Parameters
SceneBeginData
data
The initialization data (e.g. used to collect joints to link after begin). |
BreakPrefabLink()
Breaks the prefab linkage for this object, all its scripts, and all child actors.
Declaration
public virtual void BreakPrefabLink()
Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)
Deserializes object from the input stream.
Declaration
public virtual void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override
Parameters
DeserializeStream
stream
The input stream. |
ISerializeModifier
modifier
The deserialization modifier object. Always valid. |
Overrides
EndPlay()
Called when removing object from the game.
Declaration
public virtual void EndPlay() = 0
GetNamePath(Char separatorChar='/')
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
public String GetNamePath(Char separatorChar='/') const
Parameters
Char
separatorChar
The character to separate the names. |
Returns
String
The full name path. |
GetOrderInParent()
Gets zero-based index in parent actor children list (scripts or child actors).
Declaration
public virtual int32 GetOrderInParent() const = 0
Returns
int32
The order in parent. |
GetParent()
Gets the parent actor (or null if object has no parent).
Declaration
public Actor* GetParent() const
Returns
Actor
|
GetPrefabID()
Gets the prefab asset ID. Empty if no prefab link exists.
Declaration
public Guid GetPrefabID() const
Returns
Guid
|
GetPrefabObjectID()
Gets the ID of the object within a prefab that is used for synchronization with this object. Empty if no prefab link exists.
Declaration
public Guid GetPrefabObjectID() const
Returns
Guid
|
GetSceneObjectId()
Gets the scene object ID.
Declaration
public virtual Guid GetSceneObjectId() const = 0
Returns
Guid
The scene object ID. |
HasParent()
Returns true if object has a parent assigned.
Declaration
public bool HasParent() const
Returns
bool
|
HasPrefabLink()
Gets a value indicating whether this object has a valid linkage to the prefab asset.
Declaration
public bool HasPrefabLink() const
Returns
bool
|
Initialize()
Called after object loading or spawning to initialize the object (eg. call OnAwake for scripts) but before BeginPlay. Initialization should be performed only within a single SceneObject (use BeginPlay to initialize with a scene).
Declaration
public virtual void Initialize() = 0
IsDuringPlay()
Determines whether object is during play (spawned/loaded and fully initialized).
Declaration
public bool IsDuringPlay() const
Returns
bool
|
LinkPrefab(const Guid& prefabId, const Guid& prefabObjectId)
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
public virtual void LinkPrefab(const Guid& prefabId, const Guid& prefabObjectId)
Parameters
Guid
prefabId
The prefab asset identifier. |
Guid
prefabObjectId
The prefab object identifier. |
Serialize(SerializeStream& stream, const void* otherObj)
Serializes object to the output stream compared to the values of the other object instance (eg. default class object). If other object is null then serialize all properties.
Declaration
public virtual void Serialize(SerializeStream& stream, const void* otherObj) override
Parameters
SerializeStream
stream
The output stream. |
void
otherObj
The instance of the object to compare with and serialize only the modified properties. If null, then serialize all properties. |
Overrides
SetOrderInParent(int32 index)
Sets zero-based index in parent actor children list (scripts or child actors).
Declaration
public virtual void SetOrderInParent(int32 index) = 0
Parameters
int32
index
The new order in parent. |
SetParent(Actor* value)
Sets the parent actor.
Declaration
public void SetParent(Actor* value)
Parameters
Actor
value
The new parent. |
Returns
void
|
SetParent(Actor* value, bool canBreakPrefabLink)
Sets the parent actor.
Declaration
public virtual void SetParent(Actor* value, bool canBreakPrefabLink) = 0
Parameters
Actor
value
The new parent. |
bool
canBreakPrefabLink
True if can break prefab link on changing the parent. |