示例#1
0
 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);
 }
示例#2
0
 private void UnselectAnyBuilding()
 {
     _selectedCell = null;
 }
示例#3
0
 void OnCellClicked(BuildingSelectorCell cellClicked)
 {
     _selectedCell = cellClicked;
     BuildingManager.Instance.StructureToBuildSelected(_selectedCell.building.type);
 }