Hi! I've create my realisation of procedural generation. It's include 2 different variant of it: weapon generation like in Borderlands and Fallout and building generation.
The main idea of this generator is to create dependency system of building "pieces".
BuildingPiece SpawnPieceLayer(BuildingPiece[] pieceArray)
{
BuildingPiece piecePrefab = pieceArray[Random.Range(0, pieceArray.Length)];
BuildingPiece clone = Instantiate(piecePrefab, transform);
return clone;
}
Also added code for more "logic" construction of building. As example, we can't have doors on lvl > 2. Building piece include 3 empty transforms - it's created to have posibility to reuse this system with different meshes. Thanks Yevheniy Raievskyi that help me with part of logic.
The main idea is to create main object - and instantiate other parts on empty transform to create generation of pieces.
Client: Unity, C#