Kanda Foundation 0.2.0
Loading...
Searching...
No Matches
IUserSettingsService Interface Reference

Provides a way to persist user settings between application sessions. This is implemented using Unity PlayerPrefs with some handy tools for saving complex objects and sensitive data. More...

+ Inheritance diagram for IUserSettingsService:

Public Member Functions

bool HasKey (string key)
 If true, a setting with this key exists in user settings.
 
void DeleteKey (string key)
 Removes a user setting by key.
 
void ForceSave ()
 Forces user settings to be committed to disk. This should happen automatically when application exits, so use only if it is critical that a setting gets committed in case of application crash.
 
void SetInt (string key, int value)
 Commits an integer to user settings.
 
void SetFloat (string key, float value)
 Commits a float to user settings.
 
void SetString (string key, string value)
 Commits a string to user settings.
 
void SetStringWithEncryption (string key, string value)
 Encrypts and commits a string to user settings.
 
void SetObject< T > (string key, T value)
 Commits an object to user settings by serializing it as a JSON string.
 
void SetObjectWithEncryption< T > (string key, T value)
 Encrypts and commits an object to user settings by serializing it as a JSON string.
 
int GetInt (string key)
 Tries to get an int from user settings.
 
float GetFloat (string key)
 Tries to get a float from user settings.
 
string GetString (string key)
 Tries to get a string from user settings.
 
string GetEncryptedString (string key)
 Tries to get and decrypt a string from user settings.
 
GetObject< T > (string key)
 Tries to get an object from user settings.
 
GetEncryptedObject< T > (string key)
 Tries to get and decrypt an object from user settings.
 

Detailed Description

Provides a way to persist user settings between application sessions. This is implemented using Unity PlayerPrefs with some handy tools for saving complex objects and sensitive data.

Member Function Documentation

◆ DeleteKey()

void DeleteKey ( string key)

Removes a user setting by key.

Parameters
keyThe key of the user setting to remove.

Implemented in UserSettingsService.

◆ ForceSave()

void ForceSave ( )

Forces user settings to be committed to disk. This should happen automatically when application exits, so use only if it is critical that a setting gets committed in case of application crash.

Implemented in UserSettingsService.

◆ GetEncryptedObject< T >()

T GetEncryptedObject< T > ( string key)

Tries to get and decrypt an object from user settings.

Exceptions
ArgumentExceptionThrown if the key does not exist.

Implemented in UserSettingsService.

◆ GetEncryptedString()

string GetEncryptedString ( string key)

Tries to get and decrypt a string from user settings.

Exceptions
ArgumentExceptionThrown if the key does not exist.

Implemented in UserSettingsService.

◆ GetFloat()

float GetFloat ( string key)

Tries to get a float from user settings.

Exceptions
ArgumentExceptionThrown if the key does not exist.

Implemented in UserSettingsService.

◆ GetInt()

int GetInt ( string key)

Tries to get an int from user settings.

Exceptions
ArgumentExceptionThrown if the key does not exist.

Implemented in UserSettingsService.

◆ GetObject< T >()

T GetObject< T > ( string key)

Tries to get an object from user settings.

Exceptions
ArgumentExceptionThrown if the key does not exist.

Implemented in UserSettingsService.

◆ GetString()

string GetString ( string key)

Tries to get a string from user settings.

Exceptions
ArgumentExceptionThrown if the key does not exist.

Implemented in UserSettingsService.

◆ HasKey()

bool HasKey ( string key)

If true, a setting with this key exists in user settings.

Parameters
keyThe key to check.

Implemented in UserSettingsService.

◆ SetFloat()

void SetFloat ( string key,
float value )

Commits a float to user settings.

Implemented in UserSettingsService.

◆ SetInt()

void SetInt ( string key,
int value )

Commits an integer to user settings.

Implemented in UserSettingsService.

◆ SetObject< T >()

void SetObject< T > ( string key,
T value )

Commits an object to user settings by serializing it as a JSON string.

Implemented in UserSettingsService.

◆ SetObjectWithEncryption< T >()

void SetObjectWithEncryption< T > ( string key,
T value )

Encrypts and commits an object to user settings by serializing it as a JSON string.

Implemented in UserSettingsService.

◆ SetString()

void SetString ( string key,
string value )

Commits a string to user settings.

Implemented in UserSettingsService.

◆ SetStringWithEncryption()

void SetStringWithEncryption ( string key,
string value )

Encrypts and commits a string to user settings.

Implemented in UserSettingsService.


The documentation for this interface was generated from the following file: