/// <summary> /// Opens downgrade menu or destroys building /// </summary> public void Downgrade() { if (!wait) { Hide(); if (buildingLogic.ActualBuilding.GetGrade() > 1) //Downgrade building { (GameObject.Find("BuildingUpgrade").GetComponent("BuildingUpgrade") as BuildingUpgrade).Show(buildingLogic, false); } else if (buildingLogic.ActualBuilding.GetGrade() == 1) //Destroy building { GameLogic.Action(); buildingLogic.CmdChangeBuilding(Buildings.EMPTY); } } }
/// <summary> /// Applies new building /// </summary> public void ConfirmBuild() { Hide(); //Hide this window //Take money&action for building GameLogic.Action(); if (buildingLogic.ActualBuilding.GetGrade() == 0) { GameLogic.HasTurn.Money = -4; } else { GameLogic.HasTurn.Money = -1; } //Refresh player info GameLogic.ShowPlayerInfo(); //Apply building buildingLogic.CmdChangeBuilding(displayedBuildings[Selected]); }