private void genRocks(int index) { int xs = xSize / 10; int ys = ySize / 10; int count; Vector2Int pos; Vector2Int buff; for (int i = 0; i < xs; i++) { for (int j = 0; j < ys; j++) { count = 3 + Random.Range(0, 10); for (int k = 0; k < count; k++) { pos = new Vector2Int((int)Random.Range(0, 10) + i * 10, (int)Random.Range(0, 10) + j * 10); buff = grassFactory.cells[pos.x + pos.y * xSize].pos; grassFactory.DestroyCell(pos.x + pos.y * xSize); grassFactory.AddBeyond(buff, 6); //grassFactory.Add(pos, index).transform.localRotation = Quaternion.Euler(0, 0, 60 * Random.Range(1, 7)); } } } }