private void LoadNextLevel() { if (levelIndex + 1 >= levels.Length) { return; } loadedSettings = levels[++levelIndex]; scoreDisplayer?.SetLevel(CurrentLevel.Level); OnNextLevelLoadedEvent?.Invoke(); }
public void StartBoardLevelManager(IGameScoreDisplay _scoreDisplayer) { scoreDisplayer = _scoreDisplayer; levelIndex = 0; loadedSettings = levels[levelIndex]; boardScoreCalculator = new BoardHighscoreCalculator(); boardScoreCalculator.OnUpdateScoreAction = OnUpdateScoreHandler; boardScoreCalculator.OnUpdateHighScoreAction = OnUpdateHighScoreHandler; boardScoreCalculator.InitializeCalculator(0); Debug.Assert(levels.Length > 0, "Levels not loaded"); scoreDisplayer?.SetLevel(CurrentLevel.Level); progressVisual?.ClearBorders(); }