public void ApplyDamage(int damage) { if (_playerHP > 0) { _playerHP -= damage; _playerHealth.ChangeHealth(_playerHP); } else { _endGame.GameOver("Die"); } }
public void DeleteEnemy(GameObject enemy) { _prefabsCreater.Enemies.Remove(enemy); if (_prefabsCreater.Enemies.Count == 0) { if (_gameSettings.Level == 1) { _endGame.NextLevel(); } else { _endGame.GameOver("Win"); } } }