I made a building generator in Unity. Here's how it works.

A screenshot of Unity, showing a one-story building with a tall, sloped red roof topped by skylights. A panel on the side, labeled Building Builder, allows the user to configure multiple sections, each of them with its own tileset and slope values.

The first iteration was a "building builder" that automatically generated a multiple story building. It's divided into sections that sit atop one another like layers on a cake. Each section has a "tileset", which can be a type of wall, roof or window.

A screenshot of Unity, showing a bunch of blue houses made out of simple shapes like cubes and wedges. A pyramid-type shape is selected, and a panel on the side allows the user to select the slope height and which sides are flattened.

I later expanded upon this to allow for more complex shapes. Now everything is made out of boxes and "pyramids" -- a pyramid being a box with one or more sloping sides. A gizmo keeps the dimensions of the shapes integers.

Then you select the parent building and click on Regenerate. An algorithm goes through each slope or wall and maps it to a textured mesh. Windows are generated every 2 tiles. Here's what that looks like (with some manual editing for flavor):

A screenshot of a Unity scene, looking down a street with four-story brick buildings on each side.

And here are all the possible tiles:

An isometric 3D render of various three-dimensional building tiles: brick walls, brick corners, roofs, lit and unlit windows, pavement pieces, lanterns, flags, and special untextured blocks.

The funky blocks on the right are physics colliders. They are invisible in Unity.