Exemplo n.º 1
0
    public _Collider[] getFrontierColliders(_Collider c)
    {
        List <_Collider> cols = new List <_Collider>();

        foreach (_Collider other in colliders)
        {
            if (c.Equals(other))
            {
                continue;
            }

            float distance = (c.Transform.position - other.Transform.position).magnitude;

            if (distance < c.Extent + other.Extent)
            {
                cols.Add(other);
            }
        }

        return(cols.ToArray());
    }