예제 #1
0
        /// <summary>
        /// Called each time the animation changes frame.
        /// </summary>
        /// <param name="lastSeqIndex">The index of the last sequence position played.</param>
        /// <param name="currentSeqIndex">The index of the current sequence position.</param>
        protected override void AnimationFrameChanged(int lastSeqIndex, int currentSeqIndex)
        {
            // if the braking animation has finished - stop braking
            if (Animation == _brakingAnimId)
            {
                if (lastSeqIndex > currentSeqIndex)
                {
                    // come out of the braking animation, and prevent restarting it for now
                    _moveController.FinishBraking();
                }
            }

            if (Animation == _crouchAnimId)
            {
                // fully crouched - change size
                if (currentSeqIndex == 1)
                {
                    SetBoundingBox(RollingBox);
                }
            }
        }