Пример #1
0
 public void PurchaseCoins(int amount)
 {
     soundMan.Play("CoinReward");
     homeMan.totalCoins += amount;
     homeMan.SaveCoinData();
     Store.UpdateCoins();
 }
Пример #2
0
    public void purchaseCharacter(int index)
    {
        if (homeMan.totalCoins >= (int)homeMan.playerInfo[index]["price"])
        {
            soundMan.Play("Purchase");
            homeMan.totalCoins -= (int)homeMan.playerInfo[index]["price"];
            homeMan.playerInfo[index]["unlocked"] = true;
            homeMan.SavePlayerData();
            homeMan.SaveCoinData();

            Store.UpdateCoins();
            DisplayButtons();
        }
        else
        {
            Store.ShowSelectedPanel(2);
        }
    }
Пример #3
0
    public void UpgradePurchase()
    {
        int upPrice = (int)homeMan.playerInfo[currentIndex]["upgradePrice"];

        if (homeMan.totalCoins >= upPrice)
        {
            soundMan.Play("UpgradeSound");
            int lvl = (int)homeMan.playerInfo[currentIndex]["upgradelvl"];

            homeMan.totalCoins -= upPrice;
            homeMan.playerInfo[currentIndex]["upgradePrice"] = upPrice + 500;
            homeMan.playerInfo[currentIndex]["upgradelvl"]   = lvl + 1;

            homeMan.SavePlayerData();
            homeMan.SaveCoinData();

            Store.UpdateCoins();
            ShowCharacterStats(currentIndex);
        }
        else
        {
            Store.ShowSelectedPanel(2);
        }
    }
Пример #4
0
 private void AdCoins(int amount)
 {
     homeMan.totalCoins += amount;
     homeMan.SaveCoinData();
     Store.UpdateCoins();
 }