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); } }
public static MazeLevelData LoadMazeLevelData(string mazeName) { MazeLevelData mazeLevelData = new JsonMazeLevelFileReader().ReadData <MazeLevelData>(mazeName); return(mazeLevelData); }