using UnityEngine;
using System.Collections;
public class Generation : MonoBehaviour {
GameObject[,] map;
// Префабы блока и растения
public GameObject _blockprefab, _plantprefab;
// Переменные для назначения максимального количества блоков по X и Z
public int maxX, maxZ;
// Дистанция между блоками и высота от боков
public float _distance, _heightplantsdistance;
public void Start () {
map = new GameObject[maxX, maxZ];
for (int x = 0; x < maxX; x++) {
for (int z = 0; z < maxZ; z++) {
map[x, z] = (GameObject)Instantiate(_blockprefab, new Vector3(x * _distance, 0 , z * _distance), Quaternion.identity);
for (int p = 0; p < 1; p++) {
if(x==2) Instantiate (_plantprefab, new Vector3(2, _heightplantsdistance, z), Quaternion.identity);
if(z==2 && x!=2) Instantiate (_plantprefab, new Vector3(x, _heightplantsdistance, 2), Quaternion.identity);
}
}
}
}
}
каким нить условием