Пример #1
0
        /// <summary>
        /// Stops the changing of the position.
        /// </summary>
        public void StopChangingPosition( )
        {
            StateComponent stateHandler = Player.GetComponent <StateComponent>( );

            if (stateHandler.CurrentState != StateComponent.PlayerState.ChangingPosition)
            {
                throw new Exception("Can't stop changing the position if not currently changing the position.");
            }

            if (!pausedWhenChangingPosition)
            {
                stateHandler.Play( );
            }
            else
            {
                stateHandler.CurrentState = StateComponent.PlayerState.Paused;
            }
        }