Resource

1.2.0+

Base class for engine resources, such as:

.constructor(engine: WonderlandEngine, index: number) ⇒ Resource 

ParamTypeDescription
engineWonderlandEngine
indexnumber

.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.

.equals(other: undefined | null | Resource) ⇒ boolean 

Checks equality by comparing ids and not the JavaScript reference.

Deprecated: Use JavaScript reference comparison instead:

1const meshA = engine.meshes.create({vertexCount: 1});
2const meshB = engine.meshes.create({vertexCount: 1});
3const meshC = meshB;
4console.log(meshA === meshB); // false
5console.log(meshA === meshA); // true
6console.log(meshB === meshC); // true
ParamTypeDescription
otherundefined | null | Resource