using UnityEngine;
using UnityEngine.UI;
public class gamescript : MonoBehaviour
{
public static int money;
public static int upgrades;
public void LoadSave()
{
money=PlayerPrefs.GetInt("money");
upgrades=PlayerPrefs.GetInt("upgrades");
}
public void click()
{
money + upgrades;
PlayerPrefs.SetInt("money", money);
}
public void upgrade()
{
while(money == 15)
{
upgrades++;
}
PlayerPrefs.SetInt("upgrades", upgrades);
}
public void Save()
{
PlayerPrefs.SetInt("money", money);
PlayerPrefs.SetInt("upgrades", upgrades);
}
}
код