예제 #1
0
    public void UpgradeTime()
    {
        //if reached lowest time clock
        if (clock.timePerRotation <= clock.lowestClockTime)
        {
            return;
        }

        //check if can afford
        if (thisGameManager.ChangeScore((int)-currentUpgradeCost))
        {
            audioSource.clip = speedUpClip;
            audioSource.Play();

            //increase stuff
            upgradeCount++;

            currentFloatMultiple = 1f + upgradeIncreaseCurve.Evaluate(upgradeCount * upgradeStepLengthOnCurve);

            currentUpgradeCost = currentUpgradeCost * currentFloatMultiple;

            //update stuff
            TimeUpgradeButtonText.text = timeUpgradeString + ((int)currentUpgradeCost).ToString();

            clock.ChangeTimerPerRotation(-perUpgradeDecreaseRotateTimeByPercentage * clock.timePerRotation);
        }
    }