コード例 #1
0
    public void HitboxEnd(int i)
    {
        if (i < 0 || i >= hitboxes.Length)
        {
            return;
        }

        Hitbox h = hitboxes[i];

        h.Deactivate();
    }
コード例 #2
0
    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);
        }
    }