예제 #1
0
    /// <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));
    }
예제 #2
0
    /// <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);
        }
    }