Harry

Hello,
I have read the API references, know the basic functionalities of events, and have found an old blog post about it (which was for C#). But I'm new - couldn't really follow, did not really understand it as much as I wished, just a general idea. How would you e.g. add another animation to a track as soon as the current has completed playing?
var track = player.animationState.setAnimation(...)
Now I'm confused how to add the listener and what to do next.
track.addListener(?player.animationStateListener?)

Have a great day.
Harry
  • 記事: 2

Mario

You don't necessarily need a listener, you can queue up multiple animations like this:
let animState = player.animationState;
animState.setAnimation(...)
animState.addAnimation(...)
animState.addAnimation(...)
Alternatively, you can add the listener like this:
track.addListener({
complete: (track) => { ... }
});
アバター
Mario

Mario
  • 記事: 3031

Harry

Thank you very much, Mario!
Harry
  • 記事: 2


Return to Runtimes