Ejemplo n.º 1
0
    private void EnemyDestroy(PlayerBullet playerBullet)
    {
        _enemyHealth -= playerBullet.GetBulletDamage();

        if (_enemyHealth <= 0)
        {
            _scoreController.AddScorePoints(_enemyPoints);

            Destroy(gameObject);

            GameObject enemyExplosion = Instantiate(_explosionParticle, transform.position, Quaternion.identity);
            enemyExplosion.transform.parent = _root.transform;

            _audioController.PlaySound(_audioController._enemyExplosionSFX);

            Destroy(enemyExplosion, _explosionDelay);
        }
    }