public void PurchaseCoins(int amount) { soundMan.Play("CoinReward"); homeMan.totalCoins += amount; homeMan.SaveCoinData(); Store.UpdateCoins(); }
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); } }
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); } }
private void AdCoins(int amount) { homeMan.totalCoins += amount; homeMan.SaveCoinData(); Store.UpdateCoins(); }