public static InfoScene GetInstance(ConstructionBase construction) { var scene = Instantiate <InfoScene>(); scene._construction = construction; scene.Header.text = construction.GetType().Name; scene.DeleteButton.interactable = construction.Removable; return(scene); }
void ClearTask() { for (int x = 0; x < 3; x++) { for (int y = 0; y < 3; y++) { _aim[x, y].enabled = false; } } _building = null; }
public void BeginPlace(ConstructionBase building) { if (_building != null) { Destroy(_building.gameObject); } _building = building; building.transform.SetParent(transform); building.transform.localPosition = Vector3.zero; for (int x = 0; x < 3; x++) { for (int y = 0; y < 3; y++) { _aim[x, y].enabled = x < building.Size.X && y < building.Size.Y; } } }
public void PlaceConstruction(ConstructionBase constr, bool root = true) { Construction = constr; if (root) { constr.SetCell(this); for (int x = 0; x < constr.Size.X; x++) { for (int y = 0; y < constr.Size.Y; y++) { if (x != 0 || y != 0) { GetNeighbour(x, y).PlaceConstruction(constr, false); } } } } }
public void PlaceBuilding(ConstructionBase building, Point position) { this[position].PlaceConstruction(building); building.transform.SetParent(transform); building.transform.localPosition = position; }