public void HitboxEnd(int i) { if (i < 0 || i >= hitboxes.Length) { return; } Hitbox h = hitboxes[i]; h.Deactivate(); }
void OnTriggerEnter(Collider col) { Hitbox hitbox = col.GetComponent <Hitbox>(); 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); } }