General Events
Eventsβ
GLTF_ANIMATION_FINISHEDβ
Emitted when all loops of an animation clip have finished.
Propertiesβ
Property | Type | Description |
---|---|---|
name | string | The name of the animation |
Example (Global)β
world.events.addListener(world.events.globalId, ecs.events.GLTF_ANIMATION_FINISHED, (properties) => {
console.log(properties.name);
});
Example (Entity Specific)β
world.events.addListener(component.eid, ecs.events.GLTF_ANIMATION_FINISHED, (properties) => {
console.log(properties.name);
});
GLTF_ANIMATION_LOOPβ
Emitted when a single loop of the animation clip has finished.
Propertiesβ
Property | Type | Description |
---|---|---|
name | string | The name of the animation |
Example (Global)β
world.events.addListener(world.events.globalId, ecs.events.GLTF_ANIMATION_LOOP, (properties) => {
console.log(properties.name);
});
Example (Entity Specific)β
world.events.addListener(component.eid, ecs.events.GLTF_ANIMATION_LOOP, (properties) => {
console.log(properties.name);
});
GLTF_MODEL_LOADEDβ
Emitted when a model has loaded
Propertiesβ
Property | Type | Description |
---|---|---|
name | string | The name of the animation |
Example (Global)β
world.events.addListener(world.events.globalId, ecs.events.GLTF_MODEL_LOADED, (properties) => {
console.log(properties.name);
});
Example (Entity Specific)β
world.events.addListener(component.eid, ecs.events.GLTF_MODEL_LOADED, (properties) => {
console.log(properties.name);
});
SPLAT_MODEL_LOADEDβ
Emitted when a Splat has loaded
Propertiesβ
Property | Type | Description |
---|---|---|
model | SplatModel | The Splat model |
Example (Global)β
world.events.addListener(world.events.globalId, ecs.events.SPLAT_MODEL_LOADED, (model: SplatModel) => {
console.log(model);
});
Example (Entity Specific)β
world.events.addListener(component.eid, ecs.events.GLTF_MODEL_LOADED, (model: SplatModel) => {
console.log(model);
});
AUDIO_CAN_PLAY_THROUGHβ
Emitted when an entity has the capability to play Audio.
Propertiesβ
None
Exampleβ
world.events.addListener(component.eid, ecs.events.AUDIO_CAN_PLAY_THROUGH, () => {
console.log(`${component.eid} can now play audio.`);
});
AUDIO_ENDβ
Emitted when audio has finished playing on an entity.
Propertiesβ
None
Exampleβ
world.events.addListener(component.eid, ecs.events.AUDIO_END, () => {
console.log(`${component.eid} finished playing audio.`);
});