Ejemplo n.º 1
0
    void UpdateArmyCost(Dictionary <string, Resource> resources)
    {
        ArmyResource army = (ArmyResource)resources[ResourceType.ARMY];

        Text armyCost = GameObject.Find(UIConstants.UPGRADE_GOLD_COST)
                        .GetComponent <Text>();

        armyCost.text = ResourceFormatter.Format(army.upgradeCost) + " " +
                        UIConstants.GOLD_SYMBOL;
    }
Ejemplo n.º 2
0
    public void UpgradeGold(ArmyResource armyResource)
    {
        if (armyResource.currentAmount >= upgradeCost)
        {
            // Deduct armies
            armyResource.currentAmount -= upgradeCost;

            // Update growing rate and multipliers
            growingRateSeconds *= upgradeMultiplier;

            // Update upgrade cost
            upgradeCost *= upgradeCostFactor;
        }
    }
Ejemplo n.º 3
0
    public void UpgradeArmy()
    {
        ArmyResource army = (ArmyResource)resources[ResourceType.ARMY];

        army.UpgradeArmy((GoldResource)resources[ResourceType.GOLD]);
    }