Exemple #1
0
        public static List <Level> GetAllLevels()
        {
            var bestLevelTimeFileHandler = new BestLevelTimeFileHandler("bestTimes.dat");
            var sceneList = new List <Level>();

            for (int i = 1; i < SceneManager.sceneCountInBuildSettings; i++)
            {
                var level = new Level(bestLevelTimeFileHandler.LoadBestTimeForLevel(i), ((LevelEnum)i).ToString(), (LevelEnum)i);
                sceneList.Add(level);
            }
            return(sceneList);
        }
Exemple #2
0
        public static Level GetLevelFromScene(int sceneIndex)
        {
            var bestLevelTimeFileHandler = new BestLevelTimeFileHandler("bestTimes.dat");

            return(new Level(bestLevelTimeFileHandler.LoadBestTimeForLevel(sceneIndex), ((LevelEnum)sceneIndex).ToString(), ((LevelEnum)sceneIndex)));
        }