public void CreateHitbox(GameObject hitboxOwner, int team, HitInfo hitInfo) { hitbox = InstantiateHitbox(boxDefinition); hitbox.Initialize(hitboxOwner, transform, team, boxDefinition.shape, hitInfo, boxDefinition, new List <IHurtable>()); hitbox.OnHurt += DestroyBullet; hitbox.Activate(); }
void OnTriggerEnter(Collider col) { Hitbox3D hitbox = col.GetComponent <Hitbox3D>(); if (hitbox != null && hitbox.owner != this.owner) { hitbox.Deactivate(); Vector3 hitLocation = (this.transform.position + col.bounds.ClosestPoint(this.transform.position)) / 2.0f; Debug.Log(hitLocation); } }
void OnTriggerEnter(Collider col) { Hitbox3D hitbox = col.GetComponent <Hitbox3D>(); if (hitbox != null && hitbox.owner != this.owner) { Keygen entity = owner.GetComponent <Keygen>(); entity.OnHit(hitbox.damage, hitbox.owner); //Visual hit effect stuff? //Vector3 hitLocation = (this.transform.position + col.bounds.ClosestPoint(this.transform.position)) / 2.0f; } }