Ejemplo n.º 1
0
 // Update best score
 private void OnGameFinished()
 {
     if ((int)_currentScore > Data.GetBestScore())
     {
         Data.SetBestScore((int)_currentScore);
     }
 }
Ejemplo n.º 2
0
 // Update best score
 private void OnGameFinished()
 {
     if ((int)_currentScore > Data.GetBestScore())
     {
         Data.SetBestScore((int)_currentScore);
         PlaySound(_newHighScore);
     }
 }
Ejemplo n.º 3
0
        private void Start()
        {
            // Update score texts
            _bestScoreText.text = NumberFormatter.ToKMB(Data.GetBestScore());
            UpdateCurrentScoreText();

            // Subscribe to GameFinish event
            GameObject.FindWithTag(Tags.GameManager).GetComponent <GameManager>().GameFinishedEvent += OnGameFinished;
            // Subscribe to Spawn Stone event
            _stoneGenerator.OnStoneSpawnedEvent += SubscribeStonesOnBulletHitEvent;
        }