WaveEngine.Components.Animation.Animation3D.PlayAnimation C# (CSharp) Method

PlayAnimation() public method

Plays the animation. Plays the animation between the specified frames.
public PlayAnimation ( string name, int startFrame, int endFrame, bool loop = true, bool backwards = false ) : void
name string /////// The name of the animation. ///////
startFrame int /// The frame where the animation starts playing. ///
endFrame int /// The last frame of the animation to play. ///
loop bool /////// if set to true loop the animation. ///////
backwards bool /////// if set to true play the animation backwards. ///////
return void
        public override void PlayAnimation(string name, int? startFrame, int? endFrame, bool loop = true, bool backwards = false)
        {
            this.CurrentAnimation = name;
            this.BoundingBoxRefreshed = true;
            this.Loop = loop;
            this.State = AnimationState.Playing;
            this.Backwards = backwards;
            this.totalAnimTime = TimeSpan.Zero;

            int start = this.lastFrame = startFrame.HasValue ? startFrame.Value : 0;
            int end = this.targetFrame = endFrame.HasValue ? endFrame.Value : this.numFrames - 1;

            if (backwards)
            {
                this.prevFrame = end;
                this.frame = start;
            }
            else
            {
                this.prevFrame = start;
                this.frame = end;
            }
        }