Beispiel #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");
        }