Beispiel #1
0
        public void Start(Scene incomingScene, Scene outgoingScene)
        {
            if (_incomingAnimation == null)
            {
                throw new System.InvalidOperationException("Transitions cannot be started more than once");
            }

            _outgoingScene = outgoingScene;
            _incomingScene = incomingScene;

            if (outgoingScene != null)
            {
                _outgoingAnimation?.Start(outgoingScene);
                _outgoingScene.IsPaused = _pauseOutgoingScene;
                _playCount++;
            }
            else
            {
                _outgoingAnimation.Cancel();
            }

            if (incomingScene != null)
            {
                _incomingAnimation?.Start(incomingScene);
                _incomingScene.IsPaused = _pauseIncomingScene;
                _playCount++;
            }
            else
            {
                _incomingAnimation.Cancel();
            }

            _outgoingAnimation = null;
            _incomingAnimation = null;
        }