コード例 #1
0
    public void Clicked()
    {
        if (progressController.GetScore() >= Upgrades.clickCost)
        {
            progressController.RemoveMoney(Upgrades.clickCost);

            Upgrades.clickPowerLevel++;
            Upgrades.clickPower += Mathf.FloorToInt(Mathf.Pow(Upgrades.clickPowerLevel, 1.05f));
            Upgrades.clickCost  += Mathf.FloorToInt(Mathf.Pow(Upgrades.clickPowerLevel, 1.25f));

            string newText = "Level: " + Upgrades.clickPowerLevel;
            newText += "\nPixels/Click: " + Upgrades.clickPower;
            newText += "\nCost: " + Upgrades.clickCost;
            text.SetText(newText);
        }
    }
コード例 #2
0
ファイル: AutoClick.cs プロジェクト: toomanybugs1/DEVSIG
    public void Clicked()
    {
        if (progressController.GetScore() >= Upgrades.autoClickCost)
        {
            progressController.RemoveMoney(Upgrades.autoClickCost);

            Upgrades.autoClickLevel++;
            Upgrades.autoClickCost += Mathf.FloorToInt(Mathf.Pow(Upgrades.autoClickLevel * 10, 1.3f));

            string newText = "Level: " + Upgrades.autoClickLevel;
            newText += "\nClicks/Sec: " + Upgrades.autoClickLevel;
            newText += "\nCost: " + Upgrades.autoClickCost;

            text.SetText(newText);

            RestartInvoke();
        }
    }