SceneResource
1.2.0+
Base class for scene resources, such as:
Static Members
- .constructor(scene, index) ⇒ SceneResource
- SceneResource._unpackId(packed) ⇒ number
- SceneResource._unpackSceneIndex(packed) ⇒ number
Properties
- .engine
- .index
- .isDestroyed
- .scene
Methods
Constructor
.constructor(scene: Prefab, index: number) ⇒ SceneResource
| Param | Type | Description |
|---|---|---|
scene | Prefab | |
index | number |
Static Members
SceneResource._unpackId(packed: number) ⇒ number
| Param | Type | Description |
|---|---|---|
packed | number |
SceneResource._unpackSceneIndex(packed: number) ⇒ number
| Param | Type | Description |
|---|---|---|
packed | number |
Properties
.engine: WonderlandEngine
Hosting engine instance.
.index: number
Index of this resource in the Scene’s manager.
.isDestroyed: boolean
true if the object is destroyed, false otherwise.
If erasePrototypeOnDestroy is true,
reading a class attribute / method will throw.
.scene: Prefab
Hosting instance.
Methods
.equals(other: undefined | null | SceneResource) ⇒ boolean
Checks equality by comparing ids and not the JavaScript reference.
Deprecated: Use JavaScript reference comparison instead:
const meshA = engine.meshes.create({vertexCount: 1});
const meshB = engine.meshes.create({vertexCount: 1});
const meshC = meshB;
console.log(meshA === meshB); // false
console.log(meshA === meshA); // true
console.log(meshB === meshC); // true
| Param | Type | Description |
|---|---|---|
other | undefined | null | SceneResource |