mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-12-24 17:29:23 +01:00
added a way to get the current animation from a sprite animation group
This commit is contained in:
parent
79a4c36029
commit
46a4aec1c9
1 changed files with 3 additions and 2 deletions
|
@ -8,8 +8,9 @@ namespace MLEM.Animations {
|
|||
|
||||
private readonly List<ConditionedAnimation> animations = new List<ConditionedAnimation>();
|
||||
private ConditionedAnimation currAnimation;
|
||||
public AnimationFrame CurrentFrame => this.currAnimation != null ? this.currAnimation.Animation.CurrentFrame : null;
|
||||
public TextureRegion CurrentRegion => this.currAnimation != null ? this.currAnimation.Animation.CurrentRegion : null;
|
||||
public SpriteAnimation CurrentAnimation => this.currAnimation?.Animation;
|
||||
public AnimationFrame CurrentFrame => this.CurrentAnimation?.CurrentFrame;
|
||||
public TextureRegion CurrentRegion => this.CurrentAnimation?.CurrentRegion;
|
||||
|
||||
public SpriteAnimationGroup Add(SpriteAnimation anim, Func<bool> condition) {
|
||||
this.animations.Add(new ConditionedAnimation(anim, condition));
|
||||
|
|
Loading…
Reference in a new issue