private void GenerateBoard(SerializableBoard _board) { InitializeDependencies(); GridLayoutGroup gridLayoutGroup = gridObject.GetComponent <GridLayoutGroup>(); gridLayoutGroup.constraintCount = _board.boardSize; for (int i = 0; i < (_board.boardSize * _board.boardSize); i++) { // Instantiating Cells CellScript instantiatedCell = Instantiate(singleCellPrefab, gridObject.transform).GetComponent <CellScript>(); instantiatedCell.FetchDependencies(); instantiatedCell.CopyFrom(_board.serializableGrid[i]); instantiatedCell.UpdateUI(); m_cellList.Add(instantiatedCell); } }
// ----------------------- // Building Block Selection // ----------------------- #region BUILDING BLOCK SELECTION public void SelectBuildingBlock(BuildingBlock _selected) { m_currentlySelectedBuildingBlock = _selected; currentlySelectedBuildingBlock.AssignBuildingBlock(_selected, true); currentlySelectedBuildingBlock.UpdateUI(); }