ctx.scenes.vars).
Remarks
A var belongs to the scene that made it: the scene being loaded or unloaded when it was made, or else the current scene. It is removed when that scene is unloaded, unless madepersistent. A var made while no
scene is loaded belongs to none.
Methods
get()
get<Defined in: modules/scene/src/scene-vars.ts:56 A var’s value, orK>(key):SceneVarValue<K> |undefined
undefined when it does not exist.
Type Parameters
K
K extends string & object
Parameters
key
K
Returns
SceneVarValue<K> | undefined
has()
has(Defined in: modules/scene/src/scene-vars.ts:58 Whether the var exists.key):boolean
Parameters
key
string & object
Returns
boolean
init()
init<Defined in: modules/scene/src/scene-vars.ts:48 Makes a var with this value, unless it already exists.K>(key,value,options?):SceneVarValue<K>
Type Parameters
K
K extends string & object
Parameters
key
K
value
SceneVarValue<K>
options?
SceneVarOptions
Returns
SceneVarValue<K>
The var’s value: value, or the existing one.
keys()
keys(): string[]
Defined in: modules/scene/src/scene-vars.ts:66
Keys of every var.
Returns
string[]
remove()
remove(Defined in: modules/scene/src/scene-vars.ts:64 Removes a var.key):boolean
Parameters
key
string & object
Returns
boolean
Whether it existed.
set()
set<Defined in: modules/scene/src/scene-vars.ts:54 Changes a var’s value. Makes it likeK>(key,value,options?):void
init when it does not exist yet.
Type Parameters
K
K extends string & object
Parameters
key
K
value
SceneVarValue<K>
options?
SceneVarOptions
Returns
void