Hi,
I would like to create maze like this:

But I would like to do it by code (not in editor) so I could generate levels from csv, xml or similar formats. There is wall around the maze with different shapes, then there are a few objects (rectangles) which are moving inside maze and then there would be user moving in maze.
I am newbie here and I am not sure what would be best way to do this. I am thinking that one of good approach could be that I could split all objects to rectangles and have x, y, width and height with other informations in level file. With this I think I could create maze like above. The problem could be with collider. I want to have wall as one big collider. Is it possible? Or now came to my mind, that if is it possible to create object from points so I would save each corner of wall and then I could create polygon or something like that.
Thanks for help
Or would be the best create wall for level in graphic editor (with transparency) and then have each level as image and just add moving parts to it? I tried this:

And I added polygon collider to it but it generates bad paths. Why is that? Can I help it to exactly recognize walls? And how can I add points to path? I can delete/move points but I don’t know how to add one. I was searching and find that holding shift should help but it doesn’t. I am using Mac so maybe it’s another control
Why does it have to be one big collider? The level is basically made out of boxes, so why not just use box colliders?
Create a prefab using a quad and a 2d box collider (remove mesh collider first). Within your script you could now place this prefab changing the position and scale (e.g. from a CSV file), the collider will be automatically transformed accordingly. Afterwards you might want to combine your meshes for better performance and update the UVs based on world position.
There are some really good random maze generator tutorials that show you how to create random mazes using prefab objects to make the walls, doors etc. search YouTube & watch a couple to determine what ones suit you. There’s also a few that are text tutorials instead.
This tutorial could help you get started with dynamic maze generation.