Keep player inside a non-square/irregular shape area

I’m building a top-down twin-stick shooter with a level editor.

For gameplay reasons, the level is made of tiles, and the arena can be any shape whatsoever. For example (x representing a tile):

xxxxxxxxxx
xxxx  xxxx
xxxx  xxxx
xxxxxxxxxx    
      xx
xxxxxxxxxx
xxxxxxxxxx

The player can move freely inside the arena, but can’t leave it. I was wondering how to check for collisions and make sure the player can’t leave.

Any ideas?

I would make an empty gameObject with a 2d BoxCollider and place it in the empty area (so it fills the area without the x’s).
And for non-square areas, I would use a polygon collider 2D.

This will do so when the player comes to an empty tile (no x) the boxCollider/PolygonCollider 2D,
will stop the player;