public void BuildLvl() { if (!cellGrid) { cellGrid = CreateCellGridObject(); } if (!tileGrid) { tileGrid = CreateTileGridObject(); } if (cellGrid.cells.Count > 0 || tileGrid.tiles.Count > 0) { DestroyLvl(); } SetupSettings(LvlManager.Instance.lvl); cellGrid.CreateCellGrid(); Debug.Log("Сетка ячеек создана"); missingCell = cellGrid.cells[cellGrid.cells.Count - 1]; tileGrid.CreateTileGrid(cellGrid.cells.GetRange(0, cellGrid.cells.Count - 1)); Debug.Log("Сетка тайлов создана"); ChangeTilesSize(tileGrid.tiles); RandCellForTile(tileGrid.tiles, cellGrid.cells.GetRange(0, cellGrid.cells.Count - 1)); ChangeTiles(tileGrid.tiles, LvlManager.Instance.lvl); }