SceneLibrary, exposed on Context.scenes.
Properties
current
Defined in: modules/scene/src/scenes-context.type.ts:9 The scene loaded deepest, if any.readonlycurrent:Scene<never> |undefined
loaded
Defined in: modules/scene/src/scenes-context.type.ts:11 The loaded scenes, root first.readonlyloaded: readonlyScene<never>[]
vars
Defined in: modules/scene/src/scenes-context.type.ts:13 Vars shared by scenes and systems.readonlyvars:SceneVarsApi
Methods
isLoaded()
isLoaded(Defined in: modules/scene/src/scenes-context.type.ts:44 Whether a scene of this class is loaded.scene):boolean
Parameters
scene
SceneClass
Returns
boolean
load()
load<Defined in: modules/scene/src/scenes-context.type.ts:30 Moves to a scene: unloads the loaded scenes up to the deepest one it shares withTParams>(ctx,scene,options?):Promise<void>
scene’s parents, then loads its missing parents and the
scene itself.
Type Parameters
TParams
TParams
Parameters
ctx
Context
Handed to the load and unload of the scenes.
scene
SceneClass<TParams>
The scene to move to.
options?
LoadOptions<TParams>
Its params, and the parent to load it under.
Returns
Promise<void>
A promise resolved once the change is made.
Remarks
The change is queued and made when no system runs (seeSceneLibrary).
A scene already loaded is not loaded again: the scenes under it are
unloaded.
Throws
NfSceneCycleException (through the promise) When a scene ends up among its own parents.
unload()
unload(Defined in: modules/scene/src/scenes-context.type.ts:42 Unloads a scene and the scenes loaded under it: a move to its parent. Nothing happens when it is not loaded.ctx,scene):Promise<void>
Parameters
ctx
Context
Handed to the unload of the scenes.
scene
SceneClass
Returns
Promise<void>
A promise resolved once the change is made.