Ejemplo n.º 1
0
 public void Damage()
 {
     if (!_shieldActive)
     {
         _lives -= 1;
         if (_lives == 2)
         {
             _rightEngine.gameObject.SetActive(true);
         }
         else if (_lives == 1)
         {
             _leftEngine.gameObject.SetActive(true);
         }
         else if (_lives < 1)
         {
             _spawnManager.OnPlyerDeath();
             _uiManager.ShowGameOverText();
             _gameManager.GameOver();
             _uiManager.BestScore(score);
             Destroy(this.gameObject);
         }
     }
     _uiManager.UpdateLives(_lives);
 }