Beispiel #1
0
    void OnTriggerEnter(Collider coll)
    {
        Damager d = coll.GetComponentInParent <Damager>();

        if (d != null && (coll.CompareTag(tagToCheck) || d.CompareTag(tagToCheck)))
        {
            d.RecoverHealth(life);
        }
    }