NoaPrefs
Through this class, you save values to NOA Debugger's unique storage area.
Values are saved to a file under Application.persistentDataPath. Also, the saved values are excluded from iCloud/iTunes backups.
APIs
Static Methods
| API | Description |
|---|---|
| SetString(key, value) | Stores a value of string type. |
| SetInt(key, value) | Stores a value of int type. |
| SetFloat(key, value) | Stores a value of float type. |
| SetBoolean(key, value) | Stores a value of bool type. |
| GetString(key, defaultValue) | Retrieves a value of string type. If the data cannot be retrieved, it returns defaultValue. |
| GetInt(key, defaultValue) | Retrieves a value of int type. If the data cannot be retrieved, it returns defaultValue. |
| GetFloat(key, defaultValue) | Retrieves a value of float type. If the data cannot be retrieved, it returns defaultValue. |
| GetBoolean(key, defaultValue) | Retrieves a value of bool type. If the data cannot be retrieved, it returns defaultValue. |
| DeleteAt(key) | Deletes the value of the specified key. |
| DeleteAllSaveData() | Deletes all values saved through NoaPrefs. |
| DeleteAllToolData() | Deletes all values independently used by the NOA Debugger tool. |
Sample Code
#if NOA_DEBUGGER
using NoaDebugger;
#endif
public class Example
{
void ExampleMethod()
{
#if NOA_DEBUGGER
// Save value.
NoaPrefs.SetString("key", "value");
// Get value.
string value = NoaPrefs.GetString("key", "defaultValue");
// Delete value.
NoaPrefs.DeleteAt("key");
// Delete all values saved via NoaPrefs.
NoaPrefs.DeleteAllSaveData();
// Delete all values independently used by NOA Debugger.
NoaPrefs.DeleteAllToolData();
#endif
}
}
