void LoadLevel() { playingLevel = loader.Load(currentLevel); if (isInLevelEditMode) { playingLevel.OnDone += LoadLevel; } else { playingLevel.OnDone += LoadNextLevel; } player.Reset(); player.MoveTo(playingLevel.StartingPlayerPosition); player.CurrentLevel = playingLevel; editor.Target = playingLevel; editor.LevelId = currentLevel; }
void LoadLevel() { int levelId = SaveGame.GetLevelId(currentLevel); playingLevel = loader.Load(levelId); instruction.SetText(playingLevel.Instruction); if (isInLevelEditMode) { playingLevel.OnDone += LoadLevel; } else { playingLevel.OnDone += ProgressToNextLevel; } player.Reset(); player.MoveTo(playingLevel.StartingPlayerPosition); player.CurrentLevel = playingLevel; editor.Target = playingLevel; editor.LevelId = levelId; progression.SetText(string.Format(PROGRESSION, currentLevel + 1, LevelLoader.LevelCount)); currentHighScore = SaveGame.GetScore(currentLevel); }