Пример #1
0
 public void ApplyDamage(int damage)
 {
     if (_playerHP > 0)
     {
         _playerHP -= damage;
         _playerHealth.ChangeHealth(_playerHP);
     }
     else
     {
         _endGame.GameOver("Die");
     }
 }
Пример #2
0
    public void DeleteEnemy(GameObject enemy)
    {
        _prefabsCreater.Enemies.Remove(enemy);

        if (_prefabsCreater.Enemies.Count == 0)
        {
            if (_gameSettings.Level == 1)
            {
                _endGame.NextLevel();
            }
            else
            {
                _endGame.GameOver("Win");
            }
        }
    }