Access UnityEngine.PlayerPrefs encrypted by specific device.
More...
Static Public Member Functions | |
| static bool | HasKey (string key) |
Return true if key exists in the preferences. More... | |
| static void | DeleteKey (string key) |
Remove key and its corresponding value from the preferences. More... | |
| static T | GetValue< T > (string key, T defaultValue=default) |
Get the value of the specified preference key, return the defaultValue if doesn't exist. More... | |
| static void | SetValue< T > (string key, T value) |
Set the value of the specified preference key. More... | |
Access UnityEngine.PlayerPrefs encrypted by specific device.
|
static |
Return true if key exists in the preferences.
| key | Key. |
true if key exists.
|
static |
Remove key and its corresponding value from the preferences.
| key | Key. |
|
static |
Get the value of the specified preference key, return the defaultValue if doesn't exist.
This uses StringExtension.MustTo() to convert the preference string to the value. And will delete the preference if error occurs when converting or decrypting.
| T | The value type. |
| key | Key. |
| defaultValue | Default value. |
|
static |
Set the value of the specified preference key.
This use the ToString() of the value to save, or delect the preference if null.
| T | The value type. |
| key | Key. |
| value | Value. |