Exemple #1
0
        IEnumerator RestartGameProcedure()
        {
            audioManager.Fadeout();

            Time.timeScale = 1;
            fading         = true;
            Vector3 newPos = Camera.main.transform.position;

            newPos.z += 5; // TODO: fix
            blackFade.transform.position = newPos;

            PersistentEngine.SetPause(false);

            yield return(new WaitForSeconds(1.5f));

            if (PersistentEngine.GetDemo())
            {
                PersistentEngine.SetState("Global level", 1);
                PersistentEngine.SetState("Global loadingLevel", 1, true);
            }
            else
            {
                PersistentEngine.SetState("Global level", 1);
                PersistentEngine.SetState("Global loadingLevel", 1, true);
            }
            SceneManager.LoadScene("loadingScreen");
        }
Exemple #2
0
        public static void StartLevel(int levelNumber)
        {
            audioManager.Fadeout();
            PersistentEngine g = GameObject.Find("Global").GetComponent <PersistentEngine>();

            RemoveAllSavedData();
            PersistentEngine.SetState("Global level", levelNumber);
            PersistentEngine.SetState("Global loadingLevel", levelNumber, true);
            PersistentEngine.SetPause(false);
            g.StartSelectedLevel();
        }
Exemple #3
0
        IEnumerator ContinueGameProcedure()
        {
            Time.timeScale = 1;
            state.Clear();

            Initialize();

            PersistentEngine.SetPause(false);

            Time.timeScale = 1;

            SceneManager.LoadScene("loadingScreen");

            yield return(null);
        }
Exemple #4
0
        IEnumerator StartSelectedLevelProc()
        {
            audioManager.Fadeout();

            Time.timeScale = 1;
            fading         = true;
            Vector3 newPos = Camera.main.transform.position;

            newPos.z += 5;
            blackFade.transform.position = newPos;
            PersistentEngine.SetPause(false);
            yield return(new WaitForSeconds(1.5f));

            SceneManager.LoadScene("loadingScreen");
        }