Пример #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);
        }
    }