Not sure if this is a feature request or question, since I may have missed an existing feature. So I posted it under questions.
The current expected usage of animation event is like callback style:
- Register animation event on certain keyframe
RuntimeAnimationwill trigger the callback function when:
- current animation frame is larger than the registered keyframe and
- the event is not marked “done”
However, I found it difficult when mixing animation events with FSM state changing.
There are currently 2 ways i could think of to achieve:
- Animation event directly changes FSM state, but it makes things harder to debug how and when the state changed.
- Animation event tells what action is triggered by caching the event type and payload somewhere. On next update loop, the FSM reads the events triggered and perform state changes. This approach however make things happen 1 step later and produce slightly laggy response, which is my current workaround.
It would be perfect if there is a way to disable auto triggering animation events, manually get pending animation events and mark them as “done”.
Or maybe get how many frames elapsed for the current step just like how animation events are handled.
Any help is appreciated.