Exemplo n.º 1
0
    void UpdateSkillsResources()
    {
        skillsGroup.GetChild(0).GetChild(0).GetComponent <Text>().text = PlayerSkills.GetCurrentContractsTier().ToString();
        skillsGroup.GetChild(0).GetChild(1).GetComponent <Text>().text = PlayerSkills.GetNextContractsUpgradeCostsAsString();

        skillsGroup.GetChild(1).GetChild(0).GetComponent <Text>().text = PlayerSkills.GetCurrentCurrencyTier().ToString();
        skillsGroup.GetChild(1).GetChild(1).GetComponent <Text>().text = PlayerSkills.GetNextCurrencyUpgradeCostsAsString();

        skillsGroup.GetChild(2).GetChild(0).GetComponent <Text>().text = PlayerSkills.GetCurrentEfficiencyTier().ToString();
        skillsGroup.GetChild(2).GetChild(1).GetComponent <Text>().text = PlayerSkills.GetNextEfficiencyUpgradeCostsAsString();

        skillsGroup.GetChild(3).GetChild(0).GetComponent <Text>().text = PlayerSkills.GetCurrentEnergyTier().ToString();
        skillsGroup.GetChild(3).GetChild(1).GetComponent <Text>().text = PlayerSkills.GetNextEnergyUpgradeCostsAsString();

        skillsGroup.GetChild(4).GetChild(0).GetComponent <Text>().text = PlayerSkills.GetCurrentBuildingMaterialsTier().ToString();
        skillsGroup.GetChild(4).GetChild(1).GetComponent <Text>().text = PlayerSkills.GetNextBuildingMaterialsUpgradeCostsAsString();

        skillsGroup.GetChild(5).GetChild(0).GetComponent <Text>().text = PlayerSkills.GetCurrentToolPartsTier().ToString();
        skillsGroup.GetChild(5).GetChild(1).GetComponent <Text>().text = PlayerSkills.GetNextToolPartsUpgradeCostsAsString();

        skillsGroup.GetChild(6).GetChild(0).GetComponent <Text>().text = PlayerSkills.GetCurrentBookPagesTier().ToString();
        skillsGroup.GetChild(6).GetChild(1).GetComponent <Text>().text = PlayerSkills.GetNextBookPagesUpgradeCostsAsString();

        skillsGroup.GetChild(7).GetChild(0).GetComponent <Text>().text = PlayerSkills.GetCurrentLumberTreesTier().ToString();
        skillsGroup.GetChild(7).GetChild(1).GetComponent <Text>().text = PlayerSkills.GetNextLumberTreesUpgradeCostsAsString();

        skillsGroup.GetChild(8).GetChild(0).GetComponent <Text>().text = PlayerSkills.GetCurrentLumberLogsTier().ToString();
        skillsGroup.GetChild(8).GetChild(1).GetComponent <Text>().text = PlayerSkills.GetNextLumberLogsUpgradeCostsAsString();

        skillsGroup.GetChild(9).GetChild(0).GetComponent <Text>().text = PlayerSkills.GetCurrentLumberFirewoodTier().ToString();
        skillsGroup.GetChild(9).GetChild(1).GetComponent <Text>().text = PlayerSkills.GetNextLumberFirewoodUpgradeCostsAsString();
    }
Exemplo n.º 2
0
    public void UpgradeEnergy()
    {
        if (PlayerSkills.GetEnergySkill().CanBeUpgraded())
        {
            int currentTier = PlayerSkills.GetCurrentEnergyTier();

            if (PlayerSkills.GetEnergySkill().GetDevResourceQuantityAtTier(currentTier + 1).HasInInventory())
            {
                CharacterInputController.InitiateUpgrade(AnimState.UPGRADE_SKILL);

                PlayerSkills.SetCurrentEnergyTier(currentTier + 1);
                PlayerSkills.GetEnergySkill().GetDevResourceQuantityAtTier(currentTier + 1).SubtractFromInventory();
                UpdateSkillsResources();
            }
            else
            {
                Debug.Log("Insufficient Resources: " + PlayerSkills.GetEnergySkill().GetDevResourceQuantityAtTier(currentTier + 1));
            }
        }
        else
        {
            Debug.Log("Max Tier Reached: MAX ENERGY");
        }
    }