1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-22 20:58:34 +01:00

added a way to get the current animation from a sprite animation group

This commit is contained in:
Ellpeck 2019-08-21 17:04:20 +02:00
parent 79a4c36029
commit 46a4aec1c9

View file

@ -8,8 +8,9 @@ namespace MLEM.Animations {
private readonly List<ConditionedAnimation> animations = new List<ConditionedAnimation>(); private readonly List<ConditionedAnimation> animations = new List<ConditionedAnimation>();
private ConditionedAnimation currAnimation; private ConditionedAnimation currAnimation;
public AnimationFrame CurrentFrame => this.currAnimation != null ? this.currAnimation.Animation.CurrentFrame : null; public SpriteAnimation CurrentAnimation => this.currAnimation?.Animation;
public TextureRegion CurrentRegion => this.currAnimation != null ? this.currAnimation.Animation.CurrentRegion : null; public AnimationFrame CurrentFrame => this.CurrentAnimation?.CurrentFrame;
public TextureRegion CurrentRegion => this.CurrentAnimation?.CurrentRegion;
public SpriteAnimationGroup Add(SpriteAnimation anim, Func<bool> condition) { public SpriteAnimationGroup Add(SpriteAnimation anim, Func<bool> condition) {
this.animations.Add(new ConditionedAnimation(anim, condition)); this.animations.Add(new ConditionedAnimation(anim, condition));