Beispiel #1
0
        public IEnumerator LoadScene(ISceneReference scene)
        {
            _gameState.LoadingState.Value = GameState.LoadingStates.Loading;

            yield return(_transition.Show());

            if (scene != _gameState.CurrentScene.Value)
            {
                yield return(UnLoadScene());

                yield return(LoadScene(scene.SceneName));

                _gameState.CurrentScene.Value = scene;
            }

            yield return(_transition.Hide());

            _gameState.LoadingState.Value = GameState.LoadingStates.Idle;
            _gameEventBus.Fire(new SceneChangedEvent(scene));
        }
        public IEnumerator OnShow_BecomesVisible()
        {
            yield return(_transition.Show());

            Assert.That(_transition.IsVisible);
        }