I have the following script spawning my parts of my world. I would like to add another layer to this shape just bellow the current one just not sure how to do it. Here is my script so far.
using UnityEngine;
using System.Collections;
public class WorldSpawn : MonoBehaviour {
public GameObject block1;
int worldWidth = 6;
int worldHeight = 6;
float spawnSpeed = 0;
void Start ()
{
StartCoroutine(CreateWorld());
}
IEnumerator CreateWorld (){
for(int x =0; x<worldWidth; x+=1) {
yield return new WaitForSeconds(spawnSpeed);
for(int z =0; z<worldHeight; z+=1) {
yield return new WaitForSeconds(spawnSpeed);
GameObject block = Instantiate(block1,block1.transform.position, block1.transform.rotation)as GameObject;
block.transform.localPosition = new Vector3(x, 0, z);
}
}
}
}