PrefabServer
Defined in: prefab/prefabServer.ts:34
Prefab instantiation, as Res(Prefabs) hands it over.
@beta: instantiate is the whole surface and it has not moved, but its result
and override shapes are spelled in the prefab document model, which is also the
on-disk format — so their names are settled ahead of the shapes.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PrefabServer(
world,getAssets,getScenes?):PrefabServer
Defined in: prefab/prefabServer.ts:42
Parameters
Section titled “Parameters”getAssets
Section titled “getAssets”() => Assets
getScenes?
Section titled “getScenes?”() => SceneManagerState | null
Returns
Section titled “Returns”PrefabServer
Methods
Section titled “Methods”instantiate()
Section titled “instantiate()”instantiate(
pathOrAddress,options?):Promise<InstantiatePrefabResult>
Defined in: prefab/prefabServer.ts:58
Spawn a prefab into the world. What it spawns belongs to the scene that
was live when it landed, exactly like an entity that scene authored —
ownerless, a bullet or a called minion leaks into the next room. Pass
scene: false for something meant to outlive the area it came from.
Parameters
Section titled “Parameters”pathOrAddress
Section titled “pathOrAddress”string
options?
Section titled “options?”baseUrl?
Section titled “baseUrl?”string
overrides?
Section titled “overrides?”parent?
Section titled “parent?”number
scene?
Section titled “scene?”boolean
Returns
Section titled “Returns”Promise<InstantiatePrefabResult>