public void LoadNextLevel(string pickedLevel)
    {
        if (GameRules.GamePlayerType == GamePlayerType.SinglePlayer ||
            GameRules.GamePlayerType == GamePlayerType.SplitScreenMultiplayer)
        {
            MazeLevelData levelData = new JsonMazeLevelFileReader().ReadData <MazeLevelData>(pickedLevel);

            if (levelData == null)
            {
                Logger.Error($"Could not load maze level data for the randomly picked maze level {pickedLevel}");
            }

            IEnumerator loadLevelCoroutine = LoadLevelCoroutine("Maze", levelData);
            StartCoroutine(loadLevelCoroutine);
        }
        else
        {
            LoadNextMazeLevelEvent loadNextLevelEvent = new LoadNextMazeLevelEvent();
            loadNextLevelEvent.SendLoadNextMazeLevelEvent(pickedLevel);
        }
    }
Beispiel #2
0
    public static MazeLevelData LoadMazeLevelData(string mazeName)
    {
        MazeLevelData mazeLevelData = new JsonMazeLevelFileReader().ReadData <MazeLevelData>(mazeName);

        return(mazeLevelData);
    }