保存
PlayerPrefs.SetString("username", "Alice"); PlayerPrefs.SetInt("level", 5); PlayerPrefs.Save(); // 可选,但推荐写
读取
string username = PlayerPrefs.GetString("username", "defaultName"); int level = PlayerPrefs.GetInt("level", 0);
删除
PlayerPrefs.DeleteKey("username"); PlayerPrefs.DeleteAll();