/// <summary> /// Check if the next level exists /// </summary> /// <returns></returns> private string GetNextLevelName() { //Get the current level id from the scene name int currentLevelID = LevelLoading.GetLevelIDFromName(SceneManager.GetActiveScene().name); return(LevelLoading.GetLevelSceneName(currentLevelID + 1)); }
/// <summary> /// Loads this Level /// </summary> public void LoadLevel() { //Get the scene of this level and try and load it string levelName = LevelLoading.GetLevelSceneName(levelID); if (levelName != string.Empty) { SceneManager.LoadScene(levelName); } }