예제 #1
0
    public void DestroyEnemy(ParticleSystem particle)
    {
        ParticleSystem vfx = Instantiate(particle, transform.position, Quaternion.identity);

        Destroy(vfx.gameObject, vfx.main.duration);

        AudioSource.PlayClipAtPoint(audioPlayer.GetEnemyDeathSFX(), Camera.main.transform.position);

        if (!enemyMover.IsPathCompleted())
        {
            Player.score += scorePoints;
        }

        WaveSpawner.currentAmountEnemies--;
        Destroy(gameObject);
    }