Exemplo n.º 1
0
    void OnTriggerEnter2D(Collider2D col)
    {
        if (col.CompareTag("Player"))
        {
            begin.UpdateScore(soulValue);
            begin.UpdateSoul(soulCount);

            Instantiate(SoulPicked, transform.position, Quaternion.identity);

            Destroy(gameObject);
        }
    }
Exemplo n.º 2
0
    private void OnTriggerEnter2D(Collider2D col)
    {
        if (col.CompareTag("Bullet"))
        {
            healt -= col.GetComponent <BulletMan>().damageValue;
            Destroy(col.gameObject);

            if (healt <= 0)
            {
                enemySound.PlayOneShot(enemyDed);
                Instantiate(enemyBone, transform.position, Quaternion.identity);
                Destroy(gameObject);
                begin.UpdateScore(enemyScore);
            }
        }
    }