Пример #1
0
    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();
    }
Пример #2
0
    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);
    }
Пример #3
0
 void RefreshCurrAmountAmountAndCost(TextMeshProUGUI amountText, TextMeshProUGUI costText)
 {
     amountText.text = amount.ToString("f0");
     costText.text   = "Total cost: " + BuyRequirement.GetAsString(unit.buyRequirements, amount);
 }