你需要实例化游戏对象
public int minRandomSize = 1;
public int maxRandomSize = 20;
public GameObject blockPrefab;
public void Start() {
int size = Random.Range(minRandomSize,maxRandomSize+1);
blocks = new GameObject[size];
for (int i = 0 ; i < size; i++) {
blocks[i] = Instantiate(blockPrefab);
// do stuff with blocks[i] to make that block different than the rest
}
}