Skip to content

@relu-interactives/spatial-ecs


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

Type Alias: SubtreeSnapshot ​

ts
type SubtreeSnapshot = {
  entities: number[];
  components: {
     component: string;
     entries: {
        entityId: number;
        value: unknown;
     }[];
  }[];
};

Defined in: prefab/snapshotIdUtils.ts:17

Snapshot-space entity-id walking/remapping.

This module is the single source of truth for WHERE entity ids live inside a serialized world snapshot:

  • ParentId.value
  • ScriptComponent.entries[].data EntityInput ({type:"entity", value}) and ComponentInput ({type:"component", value:{entityId, …}})
  • ScriptObjectComponent.data EntityInput/ComponentInput (same shapes)
  • InstancedMeshComponent.instanceEntityIds[]
  • InstanceSlotComponent.groupEntityId

Any new id-bearing component field must be added here — serialization, instantiation and the override differ all route through this walker.

Properties ​

PropertyTypeDefined in
entitiesnumber[]prefab/snapshotIdUtils.ts:18
components{ component: string; entries: { entityId: number; value: unknown; }[]; }[]prefab/snapshotIdUtils.ts:19