public void SetUp()
 {
     SceneManager.LoadScene(
         SceneManifestTranslator.Translate(SceneManifest.DummyScene0));
     //WaitFrames(10);
     SetUpSceneTransitionButton();
 }
        public void AllManifestValuesInTranslator()
        {
            Type  manifestType   = typeof(SceneManifest);
            Array manifestScenes = manifestType.GetEnumValues();

            foreach (SceneManifest scene in manifestScenes)
            {
                Assert.That(
                    () => {
                    SceneManifestTranslator.Translate(scene);
                },
                    Throws.Nothing,
                    "There are scenes in the SceneManifest that "
                    + "haven't been added to the translation.");
            }
        }
        public IEnumerator TestLoadsTestLevel()
        {
            SceneChanger.ChangeToScene(SceneManifest.DummyScene1);
            LoadingStatus status = new LoadingStatus();

            SceneChanger.LoadFinished += status.MakeIsLoadedTrue;
            while (!status.isLoaded)
            {
                yield return(null);
            }
            SceneChanger.LoadFinished -= status.MakeIsLoadedTrue;
            Scene currentScene = SceneManager.GetActiveScene();

            Assert.That(currentScene.name,
                        Is.EqualTo(SceneManifestTranslator
                                   .Translate(SceneManifest.DummyScene1)),
                        "Fails to load a test level.");
            yield return(null);
        }
        public IEnumerator TestLoadsSceneOnButtonPress()
        {
            _sceneTransitionButton.scene = SceneManifest.TestLevel;
            _sceneTransitionButton.LoadScene();
            LoadingStatus status = new LoadingStatus();

            SceneChanger.LoadFinished += status.MakeIsLoadedTrue;
            while (!status.isLoaded)
            {
                yield return(null);
            }
            SceneChanger.LoadFinished -= status.MakeIsLoadedTrue;
            Scene currentScene = SceneManager.GetActiveScene();

            Assert.That(currentScene.name,
                        Is.EqualTo(SceneManifestTranslator
                                   .Translate(SceneManifest.TestLevel)),
                        "Fails to load a test level on button press.");
            yield return(null);
        }
Exemple #5
0
 /// <summary>
 /// Changes to the scene specified.  This also unloads the current
 /// scene.
 /// </summary>
 public static void ChangeToScene(SceneManifest scene)
 {
     SceneManager.LoadScene(
         SceneManifestTranslator.Translate(scene));
     FlagLoading();
 }