コード例 #1
0
ファイル: Enemy.cs プロジェクト: har-y/SpaceTrial
    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);
        }
    }