void InstantiateCells() { foreach (StructureBinding building in _structures) { BuildingSelectorCell cell = Instantiate(_cellTemplate, Vector3.zero, Quaternion.identity, transform); cell.InitWithBuilding(building); cell.RegisterButtonOnClick(OnCellClicked); } Destroy(_cellTemplate.gameObject); }
private void UnselectAnyBuilding() { _selectedCell = null; }
void OnCellClicked(BuildingSelectorCell cellClicked) { _selectedCell = cellClicked; BuildingManager.Instance.StructureToBuildSelected(_selectedCell.building.type); }