I have a general Animal scene which sets its particularities on _ready() from a resource file. Up to now, it had name, speed and sprite frames.
All sprite frames had at least the animations idle, run, eat and die, and then the Animal script just had to call $AnimatedSprite2D.play(state).
Now I want to switch to AnimationPlayer and I've seen that there's something like Animation Library, but I don't know what would be the recommended way of having the animations as a resource parameter like I had before.
I've seen you can also play animatedsprite2d's animations in an AnimationPlayer by keying the animation and the first and last frame with interpolation continuous. A quick workaround. The problem with this approach is that I must set the number of frames per animation, because it's not the same for every animal.
I have seen I can store the animation "montage" of the AnimationPlayer in a *.res file, which I imagine I could recover with animal_resource.animation_track/bundle and then call something like AnimationPlayer.add_track() or something like that, but seems off to do it like this.
So maybe you Jedis know the standard way of doing this, with the caveat that I might have 100 similar animals, so I really need this resource-based actor approach