Exemple #1
0
    private void Die()
    {
        Destroy(gameObject);
        GameObject pp = Instantiate(particleEffect, transform.position, Quaternion.identity) as GameObject;

        Destroy(pp, 2f);
        AudioSource.PlayClipAtPoint(DeathSound, Camera.main.transform.position, DeathVolume);
        gameSession.AddtoScore(ScoreOfEnemyDeath);
    }
Exemple #2
0
    private void Die()
    {
        gameSession.AddtoScore(scoreValue);
        Destroy(gameObject);
        GameObject flames = Instantiate(deathVFX, transform.position, transform.rotation);

        Destroy(flames, deathDurationVFX);
        AudioSource.PlayClipAtPoint(deathSound, Camera.main.transform.position, deathSoundVolume);
    }