Map Generator script ?

Hi,

I'm currently thinking about creating a map generator. And I'd like to know a way to store terrain + gameobjects as one entity.

I've seen I can't add terrain to prefab. I thought about a script that would take gameobjects AND terrain to rely them "manually" but I hope there is an optimized way to work this out =D

Regards, Sladix.

PS: I found how to generate a map =D

The basic idea is to create some “blocks” with objects and attach to them a “block” script which contain basic informations such as if it’s a border, a spawn block and so on …
And then you define a grid based on you blocks size and create a function that will look for the good blocks that can be placed, depending on position on the grid.

So the block searching function ends with an array containing ids of blocks that can be placed.

This is only my first attempt but it work well at this point. I’ll surely look for an optimized solution as the blocks are still quit big and contain too much details…