public void RecruitFrigate() { Debug.Log("Build Frigate!"); App app = UnityEngine.Object.FindObjectOfType <App>(); Nation player = State.getNations()[app.GetHumanIndex()]; PlayerPayer.PayFrigate(player); recruitingFrigatesText.text = player.getNavyProducing(MyEnum.NavyUnits.frigates).ToString(); UpdateNavyTable(); upgradeShipyardButton.interactable = false; ui_updater.updateUI(); }
public void researchTech() { string techName = hiddenTechName.text; Debug.Log(techName); Technology tech = State.GetTechnologies()[techName]; App app = UnityEngine.Object.FindObjectOfType <App>(); Nation player = State.getNations()[app.GetHumanIndex()]; PlayerPayer.PayForTechnology(player, techName); PlayerReceiver.addNewTech(player, tech); PlayerReceiver.registerTechChanges(tech, player); tech.SetDiscovered(true); tech.SetDiscoveredBy(player.getIndex()); research.interactable = false; researchPoints.text = player.Research.ToString(); numberPattents.text = player.getNumberPattents().ToString(); GameObject buttonOfResearchedTech = GetChildWithName.getChildWithName(techTreeConnector, tech.GetTechName()); Image image = buttonOfResearchedTech.GetComponent <Image>(); image.sprite = Resources.Load("AlchemistUITools/SteamContent/Sprites/Buttons/QuadroBtnBg", typeof(Sprite)) as Sprite; RectTransform imageTransform = image.rectTransform; imageTransform.ForceUpdateRectTransforms(); uI_updater.updateUI(); }
private void ExpandWarehouse() { App app = UnityEngine.Object.FindObjectOfType <App>(); int playerIndex = app.GetHumanIndex(); Nation player = State.getNations()[playerIndex]; PlayerPayer.payWarehouseExpansion(player); uiUpdater.updateUI(); }
private void addTransportCapacity() { App app = UnityEngine.Object.FindObjectOfType <App>(); Nation player = State.getNations()[app.GetHumanIndex()]; player.UseAP(1); player.useIP(1); player.consumeGoods(MyEnum.Goods.parts, 1); player.industry.addTrain(); player.industry.increaseTransportCapacity(2); uiUpdater.updateUI(); updateTransportPanel(); }
private void continueToNextTurn() { Debug.Log("Countinue to Next Turn ___________________________________________________________________________________________________________________"); ColourContries(); Debug.Log("Turn: " + State.turn); // State.TurnIncrement(); ui_updater.updateUI(); turnButton.interactable = true; while (State.GetPhase() != MyEnum.GamePhase.adminstration) { State.advanceGamePhase(); } }
private void addDoctrine() { App app = UnityEngine.Object.FindObjectOfType <App>(); int playerIndex = app.GetHumanIndex(); Nation player = State.getNations()[playerIndex]; string name = EventSystem.current.currentSelectedGameObject.name; Debug.Log(name); MyEnum.ArmyDoctrines newDoctrine = (MyEnum.ArmyDoctrines)Enum.Parse(typeof(MyEnum.ArmyDoctrines), name); Debug.Log(newDoctrine); player.landForces.addDoctrine(newDoctrine); uiUpdater.updateUI(); }
public void addAP() { App app = UnityEngine.Object.FindObjectOfType <App>(); Nation player = State.getNations()[app.GetHumanIndex()]; PlayerPayer.payForAP(player); PlayerReceiver.collectAP(player, 5); uiUpdater.updateUI(); }