コード例 #1
0
    //Update potential stat upon event that player opens menu and numOpenStatBoosts > 0
    //  ONLY updates potentialStat if potentialStat == 0 (last potential stat was already used)
    public void displayPotentialUpgrade()
    {
        if (numStatBoosts < 6)
        {
            //Obtain potential stat through a growth formula
            potentialStat = fighterInfo.getFighter().accessBaseStat(baseStat);
            potentialStat = BaseStat.statUpgradeCalc(numStatBoosts, potentialStat);

            //Set update bar to appropriate info
            updateBar.fillAmount = (float)potentialStat / MAX_STAT;

            //Unables upgrade button and update bar
            updateButton.interactable = true;
            updateBar.enabled         = true;
        }
        else
        {
            disablePotentialUpgrade();
        }
    }