public void Open(City city) { currCity = city; RefreshUnitsAvailableToBuy(); worldAgentBuyRequirementsText.text = BuyRequirement.GetAsString(AgentManager.instance.GetWorldAgentBuyRequirements()); cityWallBuyRequirementsText.text = BuyRequirement.GetAsString(UnitsManager.instance.GetCityUnitByID(UnitID.WallCity).buyRequirements); gameObject.SetActive(true); cityArmyUI.Open(GetCurrentBuildingArmy()); UIManager.instance.OnUIPanelOpen(); }
public void Refresh(Unit unitToRefresh, Army targetArmy, ArmyUI targetArmyUI) { unit = unitToRefresh; army = targetArmy; armyUI = targetArmyUI; //UI unitIcon.sprite = unitToRefresh.icon; unitNameText.text = unit.unitName; oneUnitCostText.text = "One unit cost: " + BuyRequirement.GetAsString(unit.buyRequirements); unitIcon.GetComponent <UnitIcon>().Setup(unit); }
void RefreshCurrAmountAmountAndCost(TextMeshProUGUI amountText, TextMeshProUGUI costText) { amountText.text = amount.ToString("f0"); costText.text = "Total cost: " + BuyRequirement.GetAsString(unit.buyRequirements, amount); }