コード例 #1
0
        /// <summary>
        /// Plays the animation from the start
        /// </summary>
        public void Play(AnimFinish onFinish = null)
        {
            Reset();
            Resume();

            OnFinish = onFinish;
        }
コード例 #2
0
        /// <summary>
        /// Ends the animation
        /// </summary>
        public void End()
        {
            CurFrameNum = MaxFrameIndex;
            AnimDone    = true;

            OnFinish?.Invoke();
            OnFinish = null;
        }
コード例 #3
0
        /// <summary>
        /// Resets the animation to the start
        /// </summary>
        /// <param name="resetSpeed">If true, resets the Animation's speed to its default value</param>
        public void Reset(bool resetSpeed = false)
        {
            AnimDone    = false;
            CurFrameNum = 0;
            PausedTime  = 0d;
            ResetFrameDur();
            OnFinish = null;

            //Reset the animation's speed if specified
            if (resetSpeed == true)
            {
                ResetSpeed();
            }

            DerivedReset();
        }