class SerializedSceneObject

Inherits: IScriptExportable

Serializes the current state of a scene object and allows that state to be restored.

The advantage of using this class versus normal serialization is that the deserialization happens into the original scene object, instead of creating a new scene object.

Public

Constructors

SerializedSceneObject

SerializedSceneObject(const HSceneObject &sceneObject, bool hierarchy = false)

Serializes the current state of the provided scene object.

sceneObject
Object whose state to serialize.
hierarchy
If true all children of the provided scene object will be serialized as well, otherwise just the provided object will.

Methods

Restore

void Restore()

Restores the scene object to the state as it was when this object was created.

If the scene object was deleted since it will be resurrected.

Private

Fields

mSceneObject

HSceneObject mSceneObject

mSceneObjectInstanceData

UnorderedMap<UUID, SPtr<GameObjectInstanceData>> mSceneObjectInstanceData

mRecordHierarchy

bool mRecordHierarchy

mSerializedObject

SPtr<MemoryDataStream> mSerializedObject

mSerializedObjectParentId

UUID mSerializedObjectParentId

mSerializedObjectCollection

WeakSPtr<GameObjectCollection> mSerializedObjectCollection