So you can add triggers based on the current frame rather than have to time it out and hope they sync up :P
This would be so, say, you wanted an attack's hitbox to activate four frames into the animation rather than at the first frame. As it is now, you can do it by having another system just keep time and change the hitbox after a set amount of time, but if frame rate is off or something you could end up with the hitbox being active earlier or later than expected. By exposing the current frame, we can wait until the frame is the right one before activating, which would be much more precise and ecs-friendly.
ETA: maybe not export it, but add a method like func (a *AnimationComponent)CurrentFrame() int that returns the current frame.
So you can add triggers based on the current frame rather than have to time it out and hope they sync up :P
This would be so, say, you wanted an attack's hitbox to activate four frames into the animation rather than at the first frame. As it is now, you can do it by having another system just keep time and change the hitbox after a set amount of time, but if frame rate is off or something you could end up with the hitbox being active earlier or later than expected. By exposing the current frame, we can wait until the frame is the right one before activating, which would be much more precise and ecs-friendly.
ETA: maybe not export it, but add a method like
func (a *AnimationComponent)CurrentFrame() int
that returns the current frame.