Bounds2D

There is a Bounds class for 3D AABBs and a Rect class for 2d simple rectangles (missing an Expand function by the way), but seems there is no Bounds2D for AABB in 2d only?

I can make but I am guessing Unity has internal bounds and polygon intersection tests for 2D so maybe they would be useful maths additions

I do not believe there is a built-in 2D AABB class because the built-in Collider2D classes return an instance of the 3D Bounds class

If you care enough about the Rect.Expand method, you can add it yourself as an extension method: Extension Methods - Unity Learn

And you may have noticed, Bounds are AABB meaning they are axis-aligned and cannot be rotated, but a Rect class is not axis-aligned and can be rotated. Generally the Bounds are meant for physics and Rects are meant for UI.

Yes it’s interesting that the Collider2D uses 3D bounds, but I was just looking for some maths shortcuts for 2d intersection so I will roll my own.