Ejemplo n.º 1
0
    private void Die()
    {
        gameSession.AddToKilledEnemies();
        gameSession.AddScore(scoreValue);
        Destroy(gameObject);
        GameObject explosion = Instantiate(explosionVFX, transform.position, transform.rotation);

        Destroy(explosion, 0.7f);
        if (UnityEngine.Random.Range(1, 12) == 6)
        {
            RespawnBonus();
        }
        AudioSource.PlayClipAtPoint(dieSound, Camera.main.transform.position, dieSoundVolume);
    }