Esempio n. 1
0
 public void Save(ScoreAmount score)
 {
     using (FileStream fs = new FileStream(_path, FileMode.OpenOrCreate))
     {
         _xmlSerializer.Serialize(fs, score);
     }
 }
Esempio n. 2
0
        private void StartGameOver()
        {
            _isGameOver = true;
            _gameOverMenu.ShowMenu();
            ScoreAmount recordData = _scoreSaver.Load();
            ScoreAmount scoreData  = _scoreCounter.SaveData;

            if (CurrentAuth.type != AuthType.Anonymous)
            {
                _leaderboardController.SendScore(scoreData.score);
            }

            if (scoreData.score > recordData.score)
            {
                _scoreSaver.Save(scoreData);
                _gameOverMenu.ChangeScore(scoreData.score, scoreData.score, true);
            }
            else
            {
                _gameOverMenu.ChangeScore(scoreData.score, recordData.score, false);
            }
        }