class SceneUtility

Performs various scene specific operations.

Public

Methods

staticRecordSceneObjectHierarchyInstanceData

static UnorderedMap<UUID, SPtr<GameObjectInstanceData>> RecordSceneObjectHierarchyInstanceData(const HSceneObject &root)

Traverses the object hierarchy, finds all child objects and components and records their instance data.

Instance data essentially holds the object's "identity" and by restoring it we ensure any handles pointing to the object earlier will still point to the new version.

root
Root object to traverse and record.

Returns: A map of object IDs to instance data.

staticRestoreSceneObjectHierarchyInstanceData

static void RestoreSceneObjectHierarchyInstanceData(const HSceneObject &root, const UnorderedMap<UUID, SPtr<GameObjectInstanceData>> &instanceData)

Restores instance data in the provided hierarchy, using object ids to determine what data maps to which objects.

root
Root object to traverse and restore.
instanceData
A map of object IDs to instance data, as output by RecordSceneObjectHierarchyInstanceData() method.