private void Hit(GameObject target) { Hurtbox otherHurtbox = null; if (target != null) { otherHurtbox = target.GetComponent <Hurtbox>(); } if (otherHurtbox != null) { if (!sourceTeam.IsAgainst(otherHurtbox.Team)) { otherHurtbox.GetHealed(healAmount); DestroySelf(); } } }
private void Hit(GameObject target) { Hurtbox otherHurtbox = null; if (target != null) { otherHurtbox = target.GetComponent <Hurtbox>(); } if (otherHurtbox != null && !otherHurtbox.IsInvulnerable) { if (sourceTeam.IsAgainst(otherHurtbox.Team)) { onConnectEnemy.Invoke(); otherHurtbox.GetHit(damage); } else { onConnectFriend.Invoke(); } } }
private void Hit(GameObject target) { if (target != null) { Hurtbox otherHurtbox = target.GetComponent <Hurtbox>(); if (otherHurtbox != null && !sourceTeam.IsAgainst(otherHurtbox.Team)) { otherHurtbox.GetHealed(healAmount); onHeal.Invoke(); if (makeTargetEthereal) { EtherealStatus.Apply(target); } if (destroySelfOnHit) { Destroy(gameObject); } } } }