SceneContext
此内容尚不支持你的语言。
Defined in: scene/sceneManager.ts:85
A live scene, as setup receives it and load answers with. Everything it
spawns or adopts is scene-owned and goes away when the scene unloads, which is
why an entity or an asset reference nothing records is one nothing releases.
Properties
Section titled “Properties”entities
Section titled “entities”
readonlyentities:ReadonlySet<number>
Defined in: scene/sceneManager.ts:87
readonlyname:string
Defined in: scene/sceneManager.ts:86
Methods
Section titled “Methods”adopt()
Section titled “adopt()”adopt(
entity):void
Defined in: scene/sceneManager.ts:90
Track an externally-spawned entity as scene-owned (despawned on unload).
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”void
bindPostProcess()
Section titled “bindPostProcess()”bindPostProcess(
camera,stack):void
Defined in: scene/sceneManager.ts:108
Parameters
Section titled “Parameters”camera
Section titled “camera”number
Returns
Section titled “Returns”void
despawn()
Section titled “despawn()”despawn(
entity):void
Defined in: scene/sceneManager.ts:106
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”void
registerDrawCallback()
Section titled “registerDrawCallback()”registerDrawCallback(
id,fn):void
Defined in: scene/sceneManager.ts:107
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
setPersistent()
Section titled “setPersistent()”setPersistent(
entity,persistent):void
Defined in: scene/sceneManager.ts:110
Parameters
Section titled “Parameters”entity
Section titled “entity”number
persistent
Section titled “persistent”boolean
Returns
Section titled “Returns”void
spawn()
Section titled “spawn()”spawn():
number
Defined in: scene/sceneManager.ts:88
Returns
Section titled “Returns”number
trackAssets()
Section titled “trackAssets()”trackAssets(
byType):void
Defined in: scene/sceneManager.ts:97
Track assets a loader acquired for this scene, so unload gives them back.
The asset half of adopt: a scene whose data arrives inside setup
preloads its own, and a reference nothing records is one nothing releases.
Parameters
Section titled “Parameters”byType
Section titled “byType”ReadonlyMap<string, ReadonlySet<string>>
Returns
Section titled “Returns”void
trackAssetScope()
Section titled “trackAssetScope()”trackAssetScope(
scope):void
Defined in: scene/sceneManager.ts:105
Take over the receipts a loader acquired for this scene.
What trackAssets is for a caller that only ever had paths. A caller holding receipts hands them over instead: unload then gives back the acquisitions this load made, not the oldest ones sharing their path.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
unbindPostProcess()
Section titled “unbindPostProcess()”unbindPostProcess(
camera):void
Defined in: scene/sceneManager.ts:109
Parameters
Section titled “Parameters”camera
Section titled “camera”number
Returns
Section titled “Returns”void