Ejemplo n.º 1
0
    void OnHitContact(Collider other)
    {
        if (unitHealth == null)
        {
            return;
        }
        if (!this.enabled)
        {
            return;
        }

        HitCollider otherHitCollider = other.GetComponent <HitCollider>();

        if (otherHitCollider == null || !otherHitCollider.enabled)
        {
            return;
        }
        if (unitHealth == otherHitCollider.unitHealth)
        {
            return;
        }

        unitHealth.OnHitColliderContact(this, otherHitCollider);
    }