This is unity's PlayerPrefs example is also my learning record, there are any questions welcome to communicate with me to learn!
2022.2.6f1
| Command | Description |
|---|---|
| DeleteAll | Removes all keys and values from the preferences. Use with caution. |
| DeleteKey | Removes the given key from the PlayerPrefs. If the key does not exist, DeleteKey has no impact. |
| GetFloat | Returns the value corresponding to key in the preference file if it exists. |
| GetInt | Returns the value corresponding to key in the preference file if it exists. |
| GetString | Returns the value corresponding to key in the preference file if it exists. |
| HasKey | Returns true if the given key exists in PlayerPrefs, otherwise returns false. |
| Save | Saves all modified preferences. |
| SetFloat | Sets the float value of the preference identified by the given key. You can use PlayerPrefs.GetFloat to retrieve this value. |
| SetInt | Sets a single integer value for the preference identified by the given key. You can use PlayerPrefs.GetInt to retrieve this value. |
| SetString | Sets a single string value for the preference identified by the given key. You can use PlayerPrefs.GetString to retrieve this value. |