Пример #1
0
    public void PurchasedItems()
    {
        if (click.onionsCount >= cost)
        {
            click.onionsCount  -= +cost;
            onionsSpendOnItems += cost;

            count     += 1;
            itemLevel += 1;
            cost       = Mathf.Round(baseCost * Mathf.Pow(1.20f, count));
            tickValue  = Mathf.Round(baseTickValue * Mathf.Pow(1.02f, count));

            Debug.Log(name + " upgraded to level " + itemLevel);

            if (itemLevel == 10)
            {
                AcceleratingStars.AccelerateStars();
                Debug.Log(itemB.name + " was unlocked");
            }
        }
    }
Пример #2
0
    public void PurchasedUpgrade()
    {
        if (click.onionsCount >= cost)
        {
            click.onionsCount     -= cost;
            onionsSpendOnUpgrades += cost;

            count                += 1;
            upgradeLevel         += 1;
            click.onionsPerClick += clickMultiplier;
            cost            = Mathf.Round(baseCost * Mathf.Pow(1.20f, count));
            clickMultiplier = Mathf.Round(baseClickMultiplier * Mathf.Pow(1.015f, count));

            Debug.Log(name + " upgraded to level " + upgradeLevel);

            if (upgradeLevel == 10)
            {
                AcceleratingStars.AccelerateStars();
                Debug.Log(itemB.name + " was unlocked");
            }
        }
    }