private void Attack_Target(Health target_health) { if (target_health == null) { // The collided target does not have health. } else { if (target_health.Is_Faction(faction_)) { // Is the same faction, so should not hit } else { target_health.Edit_Health(-damage_); } } }
private void Attack_Target(Health target_health) { if (target_health == null) { // The collided target does not have health. } else { if (target_health.Is_Faction(faction_)) { // Is the same faction, so should not hit } else { target_health.Edit_Health(-damage_); if (particles_ != null) { GameObject.Instantiate(particles_, this.transform.position, Quaternion.identity); } GameObject.Destroy(this.gameObject); } } }