MazeGenerator

Overview
This Javascript maze generator is used in the Fugu Maze player/widget. It's based on a recursive subdivision algorithm described in the Wikipedia article on maze generation. The complete project is available on the Unity Asset Store

Implementation
Each cell of the maze is a cube with a tile on each side (a textured plane). InstantiateFloor and InstantiateWalls instantiates the tiles - this is the time-consuming part, hence the use of coroutines and a progress indicator (I attach the script to a GameObject with a GUIText that acts as the progress display)

MakeMaze runs the maze generation algorithm, deactivating all the walls and then recursively subdividing the by activating walls and knocking holes in corridors to connect regions.

The Start function runs the wall/floor instantiation functions and then optionally activates another game object to start the game. In the case of FuguMaze, that start object is a first person controller with a script that places itself in the maze.

The maze generation can be made generic by changing the Room class to, say, use booleans for the walls. Then you can run MakeMaze and build a physical realization from the resulting maze structure.

After using the base script in Unity 2.6 I found some issues. I cannot get the 2nd plane to activate no matter how hard I try. I also modified the code above to actually run the MakeMaze routine. In this way, the generator is working, but with a single tile as its base - hoping someone with more experience can take a look and see what else can be addressed to get this fully working.

I modified version 2 of this script to accept Blender meshes. As you may know, meshes imported into Unity from Blender end up with a default Euler rotation of (270,0,0) instead of (0,0,0) when the model is in its default upright position. This version of the code adds a check to see if Euler x == 270, and adjusts accordingly. In theory you could use any floor mesh to generate a maze, not just a plane.