private static Rect RectIntersect(Rect a, Rect b)
{
float x = Mathf.Max(a.x, b.x);
float num2 = Mathf.Min((float) (a.x + a.width), (float) (b.x + b.width));
float y = Mathf.Max(a.y, b.y);
float num4 = Mathf.Min((float) (a.y + a.height), (float) (b.y + b.height));
if ((num2 >= x) && (num4 >= y))
{
return new Rect(x, y, num2 - x, num4 - y);
}
return new Rect(0f, 0f, 0f, 0f);
}
}