void CollisionWithParticle(Collider other) { Hitbox other_hb = other.GetComponent <Hitbox>(); if (other_hb != null) { if (other_hb.Type == Hitbox.BoxType.hurt) { Vector3 normalized_direction = (other_hb.gameObject.transform.position - transform.position).normalized; current_hit_data = GetComponent <ProjectileInfos>().HitInfo; other_hb.Impacted(current_hit_data, normalized_direction); } } Destroy(transform.root.gameObject); CreateEffect(transform.position); }
void CollisionWithHitbox(Collider other) { if (Active) { Hitbox other_hb = other.GetComponent <Hitbox>(); if (other_hb != null) { if (other_hb.Type == Hitbox.BoxType.hurt) { Vector3 normalized_direction = (other_hb.gameObject.transform.position - transform.position).normalized; other_hb.Impacted(current_hit_data, normalized_direction); CreateEffect(transform.position); } } } }