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); }