public override GameObject Generate() { Map map = config.MapGenerator.Generate(); IHeightMap floor = config.FloorHeightMapModule.GetHeightMap(); IHeightMap ceiling = config.CeilingHeightMapModule.GetHeightMap(); CaveWallModule caveWalls = config.WallModule; Map[,] mapChunks = MapSplitter.Subdivide(map); CaveMeshes[,] caveChunks = GenerateCaveChunks(mapChunks, config.CaveType, config.Scale, floor, ceiling, caveWalls); ThreeTierCave cave = new ThreeTierCave(caveChunks); AssignMaterials(cave, config.FloorMaterial, config.WallMaterial, config.CeilingMaterial); return(cave.GameObject); }