It's been a while since I last posted here! I've completely changed my dungeon generation algorithm to be faster and more flexible. The previous method required a lot of destroying of blocks and instantiation of thousands of objects. I've since used pooling and made dungeon creation almost instantaneous.
First thing that was wrong with my generation code was it relied on triggers to destroy blocks. This is heavily unoptimised as it meant every block having colliders. Instead I switched to a chunk reliant algorithm.
I split the game world into chunks of 5 x 5 units.
Then I start generating rooms. First I allocate an unused chunk with an origin room. Then I give the room a random chunk offset on it's edges, giving it a width and a height. I generate another room, randomizing it's offsets and checking if chunks overlap via math instead of colliders. I also give rooms a default unused offset so that rooms will never touch.
Corridor generation is pretty much the same, but with chunks instead, so it's cleaner and no destroying. When I place down corridor chunks I check if the chunk is occupied first, therefore, there is no need to destroy any blocks, and corridors overlap very nicely.
Fleshed out with blocks placed, the dungeon will look a bit like this. You have to prepare 5x5 blocks to place down of course, but they can be randomised, giving each room a unique look.
Walls are still a problem for me currently, I'm trying to find a method that will make creating walls easier and more efficiently. Right now, I'm just culling walls that are beside one another using a distance and orientation check.
With art assets in this is how my game currently looks. The big room is a pre made set of chunks but using the same offset guide.