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:
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 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));
|
||||||
|
|
Loading…
Reference in a new issue