UltravioletFramework / ultraviolet

The Ultraviolet Framework is a .NET game development framework written in C#.
https://github.com/UltravioletFramework/ultraviolet/wiki
MIT License
542 stars 46 forks source link

Added getter to get the current played animation #45

Closed ghost closed 7 years ago

ghost commented 7 years ago

I needed a way to check what was the current animation of a SpriteAnimationController

example:

                if(SpriteAnimationController.Animation == null || SpriteAnimationController.Animation.Name != "run")
                    SpriteAnimationController.PlayAnimation(Sprite["run"]);

I'm not sure if that's the best way to do it, but that's the only solution i found

tlgkccampbell commented 7 years ago

I'm fine with adding this, but given that the class already has a GetFrame() method, I think it would be best for this to be a corresponding GetAnimation() method instead of a property for consistency.

ghost commented 7 years ago

Done 😄