public static void DrawWireBounds(Vector3 center, Vector3 size, Color lineColor, Neighbors sides)
{
float bh = size.y-0.2f;
float bs = size.x-0.2f;
Vector3 here = center + new Vector3(-bs/2+0.1f, -bh/2+0.1f, -bs/2+0.1f);
if((sides & Neighbors.FrontLeft) != 0) {
Vector3[] frontLeft = new Vector3[]{
here+new Vector3(0,0,bs),
here+new Vector3(0,bh,bs),
here+new Vector3(0,bh,0),
here+new Vector3(0,0,0)
};
Handles.DrawSolidRectangleWithOutline(frontLeft, Color.clear, lineColor);
}
if((sides & Neighbors.FrontRight) != 0) {
Vector3[] frontRight = new Vector3[]{
here+new Vector3(0,0,0),
here+new Vector3(bs,0,0),
here+new Vector3(bs,bh,0),
here+new Vector3(0,bh,0),
};
Handles.DrawSolidRectangleWithOutline(frontRight, Color.clear, lineColor);
}
if((sides & Neighbors.Top) != 0) {
Vector3[] top = new Vector3[]{
here+new Vector3(bs,bh,0),
here+new Vector3(bs,bh,bs),
here+new Vector3(0,bh,bs),
here+new Vector3(0,bh,0),
};
Handles.DrawSolidRectangleWithOutline(top, Color.clear, lineColor);
}
if((sides & Neighbors.Bottom) != 0) {
Vector3[] bottom = new Vector3[]{
here+new Vector3(bs,0,0),
here+new Vector3(bs,0,bs),
here+new Vector3(0,0,bs),
here+new Vector3(0,0,0),
};
Handles.DrawSolidRectangleWithOutline(bottom, Color.clear, lineColor);
}
if((sides & Neighbors.BackLeft) != 0) {
Vector3[] backLeft = new Vector3[]{
here+new Vector3(0,0,bs),
here+new Vector3(bs,0,bs),
here+new Vector3(bs,bh,bs),
here+new Vector3(0,bh,bs),
};
Handles.DrawSolidRectangleWithOutline(backLeft, Color.clear, lineColor);
}
if((sides & Neighbors.BackRight) != 0) {
Vector3[] backRight = new Vector3[]{
here+new Vector3(bs,bh,bs),
here+new Vector3(bs,0,bs),
here+new Vector3(bs,0,0),
here+new Vector3(bs,bh,0)
};
Handles.DrawSolidRectangleWithOutline(backRight, Color.clear, lineColor);
}
}