public void SaveUpgradeButton(CUpgrade upgradeButton) { string key = upgradeButton.upgradeName; PlayerPrefs.SetInt(key + "_level", upgradeButton.level); PlayerPrefs.SetInt(key + "_goldByUpgrade", upgradeButton.goldByUpgrade); PlayerPrefs.SetInt(key + "_cost", upgradeButton.currentCost); }
public void LoadUpgradeButton(CUpgrade upgradeButton) { string key = upgradeButton.upgradeName; upgradeButton.level = PlayerPrefs.GetInt(key + "_level", 1); upgradeButton.goldByUpgrade = PlayerPrefs.GetInt(key + "_goldByUpgrade", upgradeButton.startGoldByUpgrade); upgradeButton.currentCost = PlayerPrefs.GetInt(key + "_cost", upgradeButton.startCurrentCost); }