public Costume StartAnimation(Animation animation) { CurrentFrameIndex = 1; this.animation = animation; elapsedFrameSeconds = 0; return this; }
public void StopAnimation() { this.animation = null; }
/// <summary> /// Create an animation using all frames with the same time per frame /// </summary> /// <param name="frameSeconds">Seconds per frame</param> /// <returns>The generated animation object</returns> public Animation CreateAnimation(float frameSeconds) { this.frameSeconds = frameSeconds; Animation animation = new Animation(); for (int i = 0; i < this.FrameCount; i++) { animation.AddFrame(i+1, frameSeconds); } return animation; }