Examples
// With ScenePlugin installed, adding the component queues its scene ID.
const entity = world.spawn([new SceneInstance(sceneHandle)])
// The scene is restored later when its asset becomes available.Function
initSceneInstance(entity: EntityHandle, world: World): voidQueues a newly added SceneInstance for deferred scene spawning.
ScenePlugin installs this function as the add callback in a
ComponentHook. It looks up the instance on the entity, reads
sceneInstance.handle.id(), obtains the world’s SceneSpawner, and
records the scene asset ID together with the entity. The scene does not need
to be loaded yet; it remains pending until its asset becomes available.
// With ScenePlugin installed, adding the component queues its scene ID.
const entity = world.spawn([new SceneInstance(sceneHandle)])
// The scene is restored later when its asset becomes available.