public void GameCompleted() { string mode = GetGameModeString(); int bestScore = highscoreProvider.GetHighScore(mode); foreach (var score in Scores) { if (score > bestScore) { bestScore = score; highscoreProvider.SaveHighScore(score, mode); } } }
private void Awake() { MemoryGame.Current.IsBusy = true; numberOfPlayers = MemoryGame.Current.Players; bool isSinglePlayer = numberOfPlayers == 1; SinglePlayerContainer.SetActive(isSinglePlayer); TwoPlayerContainer.SetActive(!isSinglePlayer); string gameMode = MemoryGame.Current.GetGameModeString(); IHighscoreProvider highscoreProvider = MiscFactory.GetHighscoreProvider(); Highscore = highscoreProvider.GetHighScore(gameMode); //Highscore = 777; }