This Interface is intended to allow consistent access to either Player Preferences(available in final build) or Editor Preferences(available only when running in the editor). Two classes in this Product: EditorPrefInterface, and PlayerPrefInterface implement the IStorePreferences interface, using Unity's EditorPref, and PlayerPref classes respectively.
Public Member Functions | |
void | DeleteAll () |
Removes ALL keys and values from the preferences. Use with caution. | |
void | DeleteKey (string key) |
Removes key and its corresponding value from the preferences. | |
Object | GetAssetAtPath (string key) |
Loads the resource at the path specified in the value associated with this key, from prefBase. | |
float | GetFloat (string key) |
Returns the value corresponding to key in the preference file if it exists. | |
int | GetInt (string key) |
Returns the value corresponding to key in the preference file if it exists. | |
string | GetString (string key) |
Returns the value corresponding to key in the preference file if it exists. | |
bool | HasKey (string key) |
Returns true if key exists in the preferences. | |
void | Save () |
Writes all modified preferences to disk. | |
void | SetAssetPath (string key, Object value) |
Determines th Path of the Object, and sets the string value of the preference associated with this key to the path. | |
void | SetFloat (string key, float value) |
Sets the value of the preference identified by key to the provided value. | |
void | SetInt (string key, int value) |
Sets the value of the preference identified by key to the provided value. | |
void | SetString (string key, string value) |
Sets the value of the preference identified by key to the provided value. | |