MeshCreator.GetBounds C# (CSharp) 메소드

GetBounds() 개인적인 정적인 메소드

private static GetBounds ( IEnumerable poly ) : Rect
poly IEnumerable
리턴 Rect
    private static Rect GetBounds(IEnumerable<Vector2> poly)
    {
        float bx1 = poly.Min(p => p.x);
        float by1 = poly.Min(p => p.y);
        float bx2 = poly.Max(p => p.x);
        float by2 = poly.Max(p => p.y);

        return new Rect(bx1, by1, bx2 - bx1, by2 - by1);
    }