Beispiel #1
0
    private void Die()
    {
        collectablesScript.SpawnRandomCollectable(transform);
        scoreManagerScript.AddScore(pointsOnDeath);
        AudioSource.PlayClipAtPoint(deathSound, transform.position);
        var explosionEffect = Instantiate(explosionEffectPrefab, transform.position, Quaternion.identity) as GameObject;

        Destroy(gameObject);
        Destroy(explosionEffect, 1f);
    }
Beispiel #2
0
    public void DestroyByPlayer()
    {
        Debug.Log("Destroyed by the player");

        score.RaiseScore(pointsOnPlayerDestruction);

        collectables.SpawnRandomCollectable(transform);

        enemiesScript.currentEnemiesAmount--;
        Destroy(this.gameObject);
    }