getGlobal
@zylem/game-lib / globals / getGlobal
Function: getGlobal()
getGlobal<
T>(path):T|undefined
Defined in: packages/game-lib/src/lib/game/game-state.ts:57
Get a global value by path.
Type Parameters
T
T = unknown
Parameters
path
string
Returns
T | undefined
Examples
getGlobal('score') // 100
getGlobal<number>('player.health') // 50