I am asking this question here because i think i might be approaching this problem the wrong way. I am trying to program a grid system that will allow my players to design map layout similar to what you see in Dungeon Keeper or Evil Genius. I want the ability to load those layout and control their position in the scene, so i created a GridController object for that.
During Start the controller runs this code:
gridArray= new GameObject[gridSize,gridSize];
for (int i=0;i<gridSize;i++)
{
for (int n=0;n<gridSize;n++)
{
gridArray[i,n]=Instantiate(gridBlock,new Vector3(n,0,i),transform.rotation) as GameObject;
gridArray[i,n].transform.parent=transform;
}
}
gridBlock being the basic prefab later to be replaced by other prefabs through input, however even when that prefab is a basic block object the load time is very long and my pc slows down when i try to select several block through the scene camera. The current gridSize is 100.
Any lower grid size and my players won’t have enough room to design layouts. Anyway to make this more efficient? Any ideas on a better approach?