Événements relatifs aux actifs
Les événements de l'actif sont émis sur l'entité de l'actif et remontent jusqu'au world.events.globalId.
Modèle 3D
GLTF_MODEL_LOADED
Emis lorsqu'un modèle a été chargé
Propriétés
| Propriété | Type | Description |
|---|---|---|
| modèle | Groupe | Le groupe three.js |
Exemple
- .listen
- .onEvent
- .addEventListener
defineState('initial-state').initial().listen(eid, ecs.events.GLTF_MODEL_LOADED, (event) => {
console.log('Model loaded: ', event.data.model)
})
GLTF_ANIMATION_FINISHED
Emis lorsque toutes les boucles d'un clip d'animation sont terminées.
Propriétés
| Propriété | Type | Description |
|---|---|---|
| nom | chaîne de caractères | Le nom de l'animation |
Exemple
- .listen
- .onEvent
- .addEventListener
defineState('initial-state').initial().listen(eid, ecs.events.GLTF_ANIMATION_FINISHED, (event) => {
console.log('Animation finished: ', event.data.name)
})
GLTF_ANIMATION_LOOP
Emis lorsqu'une seule boucle du clip d'animation est terminée.
Propriétés
| Propriété | Type | Description |
|---|---|---|
| nom | chaîne de caractères | Le nom de l'animation |
Exemple
- .listen
- .onEvent
- .addEventListener
defineState('initial-state').initial().listen(eid, ecs.events.GLTF_ANIMATION_LOOP, (event) => {
console.log('Animation loop: ', event.data.name)
})