public void ChangeAnimation(Animation Animation, ChangeAnimationOptions Options) { CurrentAnimation = Animation; IsLooping = Animation.Loops; if ((Options & ChangeAnimationOptions.Reset) == ChangeAnimationOptions.Reset) { CurrentFrame = 0; } if ((Options & ChangeAnimationOptions.Play) == ChangeAnimationOptions.Play) { IsPlaying = true; } if ((Options & ChangeAnimationOptions.Stop) == ChangeAnimationOptions.Stop) { IsPlaying = false; } if (CurrentAnimation != null) { if (CurrentFrame >= Animation.GetFrameCount()) { CurrentFrame = Animation.GetFrameCount() - 1; } } OnAnimationChanged(); }
public void Play(Animation Animation) { CurrentAnimation = Animation; if (CurrentFrame >= Animation.GetFrameCount()) { CurrentFrame = Animation.GetFrameCount() - 1; } IsPlaying = true; }
public void Play(Animation Animation) { CurrentAnimation = Animation; if (CurrentFrame >= Animation.GetFrameCount()) { CurrentFrame = Animation.GetFrameCount() - 1; } IsPlaying = true; IsLooping = Animation.Loops; OnAnimationChanged(); }
public void NextFrame() { CurrentFrame++; if (CurrentAnimation != null && CurrentFrame >= CurrentAnimation.GetFrameCount()) { if (IsLooping) { CurrentFrame = 0; } else { CurrentFrame = CurrentAnimation.GetFrameCount() - 1; } } }