Example #1
0
    void OnDestroy()
    {
        onDeath.Invoke();
        Player.instance.AddScore(scoreValue);

        if (_explosions == null)
        {
            return;
        }

        _explosions.MakeExplosion(transform.position);
    }
Example #2
0
    private void Die()
    {
        _player.AddScore(scoreValue);

        if (_explosions == null)
        {
            return;
        }

        _explosions.MakeExplosion(transform.position);
        Destroy(gameObject);
    }