PlayerPrefs Not working
问题 Hey so im trying out unitys Playerprefs method and some how it wont save coins and when i close and exit the game it wont save it... public Text CoinsText; public int Coins; public int clicks; void Start() { PlayerPrefs.GetInt("Coins", Coins); } void Update() { CoinsText.text = "Memes: " + Coins; if (Input.GetMouseButtonDown(0)) { PlayerPrefs.SetInt("Coins", Coins); Coins += clicks; } } } 回答1: You're never assigning to your Coins. Try this in your Start(): Coins = PlayerPrefs.GetInt("Coins");