/// <summary>
        /// Starts playing the animation.
        /// </summary>
        /// <param name="animation">The animation that is wanted to be played.</param>
        /// <param name="resume">If the animation should continue where it was left (true) or restart (false, default).</param>
        public void Play(SimpleAnimation animation, bool resume = false)
        {
            playingAnimations.Add(animation);

            if (!resume)
            {
                animation.Reset();
            }

            animationsToStop.Remove(animation);
        }
        /// <summary>
        /// Starts playing the animation.
        /// </summary>
        /// <param name="animation">The animation that is wanted to be played.</param>
        /// <param name="resume">If the animation should continue where it was left (true) or restart (false, default).</param>
        public void Play(SimpleAnimation animation, bool resume = false)
        {
            playingAnimations.Add(animation);

            if (!resume) //TODO: If resume is true but the animation already finished, restart (or add another parameter "restartAtFinish" in the SimpleAnimation class?)
            {
                animation.Reset();
            }

            animationsToStop.Remove(animation);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Starts playing the animation.
        /// </summary>
        /// <param name="animation">The animation that is wanted to be played.</param>
        /// <param name="resume">If the animation should continue where it was left (true) or restart (false, default).</param>
        public void Play(SimpleAnimation animation, bool resume = false)
        {
            if (playingAnimations == null)
            {
                playingAnimations = new HashSet <SimpleAnimation>();
            }

            if (playingAnimations.Add(animation))
            {
                if (!resume)
                {
                    animation.Reset();
                }
            }
        }