![]() |
LootLocker Unity SDK 8.2.0
Game backend SDK for Unity
|
Implement this interface to create a custom persistent state writer for saving and loading player state data. More...
Inherited by LootLocker.LootLockerNullStateWriter, and LootLocker.LootLockerPlayerPrefsStateWriter.
Public Member Functions | |
| string | GetString (string key, string defaultValue="") |
| Get a string from persistent storage. | |
| void | SetString (string key, string value) |
| Set a string in persistent storage. | |
| int | GetInt (string key, int defaultValue=0) |
| Get an int from persistent storage. | |
| void | SetInt (string key, int value) |
| Set an integer in persistent storage. | |
| void | DeleteKey (string key) |
| Delete a key from persistent storage. | |
| bool | HasKey (string key) |
| Check if a key exists in persistent storage. | |
Implement this interface to create a custom persistent state writer for saving and loading player state data.
The default implementation uses Unity's PlayerPrefs. If that is something you do not want then you can implement this interface and set your implementation using LootLockerSDKManager.SetStateWriter The requirements are:
| void LootLocker.ILootLockerStateWriter.DeleteKey | ( | string | key | ) |
Delete a key from persistent storage.
| key | The key to delete. |
| int LootLocker.ILootLockerStateWriter.GetInt | ( | string | key, |
| int | defaultValue = 0 |
||
| ) |
Get an int from persistent storage.
If the key does not exist then return the provided default value.
| key | The key to retrieve the value for. |
| defaultValue | The value to return if the key does not exist. |
| string LootLocker.ILootLockerStateWriter.GetString | ( | string | key, |
| string | defaultValue = "" |
||
| ) |
Get a string from persistent storage.
If the key does not exist then return the provided default value.
| key | The key to retrieve the value for. |
| defaultValue | The value to return if the key does not exist. |
| bool LootLocker.ILootLockerStateWriter.HasKey | ( | string | key | ) |
Check if a key exists in persistent storage.
| key | The key to check for existence. |
| void LootLocker.ILootLockerStateWriter.SetInt | ( | string | key, |
| int | value | ||
| ) |
Set an integer in persistent storage.
| key | The key to set the value for. |
| value | The value to set. |
| void LootLocker.ILootLockerStateWriter.SetString | ( | string | key, |
| string | value | ||
| ) |
Set a string in persistent storage.
| key | The key to set the value for. |
| value | The value to set. |