Skip to content

@relu-interactives/spatial-ecs


@relu-interactives/spatial-ecs / index / remapSnapshotEntityIds

Function: remapSnapshotEntityIds() ​

ts
function remapSnapshotEntityIds(
   snapshot, 
   idMap, 
   options?): {
  snapshot: SubtreeSnapshot;
  warnings: ExternalRefWarning[];
};

Defined in: prefab/snapshotIdUtils.ts:108

Return a deep-cloned snapshot with every entity id (entity list, entry keys, and all id-bearing component fields) remapped through idMap. References to ids missing from the map follow externalRefPolicy and are reported in warnings (with ids in the INPUT snapshot's id space).

Parameters ​

ParameterType
snapshotSubtreeSnapshot
idMapMap<number, number>
options?RemapSnapshotOptions

Returns ​

ts
{
  snapshot: SubtreeSnapshot;
  warnings: ExternalRefWarning[];
}
NameTypeDefined in
snapshotSubtreeSnapshotprefab/snapshotIdUtils.ts:112
warningsExternalRefWarning[]prefab/snapshotIdUtils.ts:112