TGameStateManager
Index
Constructors
publicconstructor
Methods
publiccurrent
Returns undefined | default
publicgetActiveCamera
Returns undefined | ICamera
publicgetLighting
Returns TSerializedLighting
publicgetRenderTasks
Returns TSerializedRenderTask[]
publicpop
Triggers [[
TGameState.onLeave
]] on current state, removes from it from the stack. Makes the state below the current state and then calls [[`TGameState.onResume``]]It does not trigger [[
TGameState.onEnter
]].Parameters
rest...args: unknown[]
args to pass to the resumed state
Returns Promise<void>
publicpush
Pushes a new state onto the stack. It triggers [[
TGameState.onEnter
]] on the new state.It does not trigger [[
TGameState.onLeave
]] on previously active state.Parameters
name: string
state name
rest...args: unknown[]
args to pass to the resumed state
Returns Promise<void>
publicregister
Register new state type with the manager. Usually done as game init.
Parameters
name: string
state: TGameStateType
Returns void
publicswitch
Switches the current active state with the provided one. Triggers [[
TGameState.onLeave
]] on the previously active state, then [[TGameState.onEnter
]] on the new state.Parameters
name: string
state name
rest...args: unknown[]
args to pass to the new state
Returns Promise<void>
publicupdate
Parameters
delta: number
Returns Promise<undefined | TWorldUpdateStats>
Returns the current active state or undefined if no state active.