示例#1
0
        public void TransitionTo(IGameState state, ITransitionController transition)
        {
            if (_nextState != null)
            {
                _logger.LogError(
                    "Cannot start transitioning to a new state while another " +
                    "state transition is in progress!");
                return;
            }

            _nextState = state;
            _currentTransitionController = transition;

            transition.Setup();
            transition.TransitionOutFinished += HandleTransitionOutFinished;
            transition.StartTransitionOut();
        }
示例#2
0
        void UpdateTransition(float dt)
        {
            m_currentTransition.Update(dt);
            if(m_currentTransition.IsFinished)
            {
                float remTime = m_currentTransition.OverTime;

                // end the transition
                m_currentItem = m_currentTransition.Item2;
                m_currentTransition = null;

                m_currentItem.DisplayController.Update(remTime);
            }
        }
示例#3
0
        void BeginTransition(MessageQueueItem from, MessageQueueItem to, float initialStep)
        {
            m_currentTransition = GetTransitionController(from, to);
            m_currentItem = null;

            UpdateTransition(initialStep);
        }