Exemplo n.º 1
0
    private void OnCollisionEnter(Collision other)
    {
        health enemy = other.gameObject.GetComponent <health>();

        if (enemy)
        {
            enemy.receive_damage(damage);
        }
        target tg = other.gameObject.GetComponent <target>();

        if (tg)
        {
            tg.call();
        }
    }