IEnumerator NextMap() { s_camera.staticCam.StartCoroutine(s_camera.staticCam.Fade(Color.black, 5)); s_levelloader lo = s_levelloader.load; Grid.ClearGrid(); game_on = false; if (lo.currentlevel == lo.LevelData.Count - 1) { PlayerPrefs.SetInt("GameCompleted", 1); PlayerPrefs.Save(); UnityEngine.SceneManagement.SceneManager.LoadScene("Title"); } lo.currentlevel++; int curlev = lo.currentlevel; PlayerPrefs.SetInt("CurrentLevel", curlev); PlayerPrefs.Save(); yield return(new WaitForSeconds(1f)); s_camera.staticCam.StartCoroutine(s_camera.staticCam.Fade(Color.clear, 5)); s_levelloader.load.LoadData(); //Grid.Initialize(); InitCharacters(); game_on = true; }
private void Awake() { scenename = UnityEngine.SceneManagement.SceneManager.GetActiveScene().name.ToString(); if (load == null) { load = this; } currentlevel = s_mainmenu.loadedLevelNum; }