Example #1
0
 /// <overloads>
 /// <summary>
 /// Stops the animation.
 /// </summary>
 /// </overloads>
 ///
 /// <summary>
 /// Stops the animation immediately.
 /// </summary>
 /// <remarks>
 /// <para>
 /// Once the animation is stopped, call <see cref="Start()"/> to restart the animation.
 /// </para>
 /// <para>
 /// Note that calling the method <see cref="Stop()"/> (or one of its overloads) has no effect if
 /// the animation controller is invalid.
 /// </para>
 /// <para>
 /// <strong>Important:</strong> When animations are started or stopped the animations do not
 /// take effect immediately. That means the new animation values are not immediately applied to
 /// the properties that are being animated. The animations are evaluated when the animation
 /// system is updated (see <see cref="AnimationManager.Update"/>) and new animation values are
 /// written when <see cref="AnimationManager.ApplyAnimations"/> is called.
 /// </para>
 /// <para>
 /// The method <see cref="UpdateAndApply"/> can be called to immediately evaluate and apply the
 /// animation. But in most cases it is not necessary to call this method explicitly.
 /// </para>
 /// </remarks>
 public void Stop()
 {
     if (IsValid)
     {
         _animationManager.StopAnimation(_animationInstance);
     }
 }
Example #2
0
        /// <summary>
        /// Stops all animations that affect the animation tree (such as animations that control the
        /// speed ratios or animation weights).
        /// </summary>
        /// <param name="animationManager">The <see cref="AnimationManager"/>.</param>
        internal void StopSecondaryAnimations(AnimationManager animationManager)
        {
            if (((IAnimatableProperty <float>)_speedProperty).IsAnimated)
            {
                animationManager.StopAnimation(_speedProperty);
                animationManager.UpdateAndApplyAnimation(_speedProperty);
            }

            if (((IAnimatableProperty <float>)_weightProperty).IsAnimated)
            {
                animationManager.StopAnimation(_weightProperty);
                animationManager.UpdateAndApplyAnimation(_weightProperty);
            }

            foreach (var child in Children)
            {
                child.StopSecondaryAnimations(animationManager);
            }
        }