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. |
| SetSByte(key, value) | Stores a value of sbyte type. |
| SetByte(key, value) | Stores a value of byte type. |
| SetShort(key, value) | Stores a value of short type. |
| SetUShort(key, value) | Stores a value of ushort type. |
| SetInt(key, value) | Stores a value of int type. |
| SetUInt(key, value) | Stores a value of uint type. |
| SetLong(key, value) | Stores a value of long type. |
| SetULong(key, value) | Stores a value of ulong type. |
| SetChar(key, value) | Stores a value of char type. |
| SetFloat(key, value) | Stores a value of float type. |
| SetDouble(key, value) | Stores a value of double type. |
| SetDecimal(key, value) | Stores a value of decimal 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. |
| GetSByte(key, defaultValue) | Retrieves a value of sbyte type. If the data cannot be retrieved, it returns defaultValue. |
| GetByte(key, defaultValue) | Retrieves a value of byte type. If the data cannot be retrieved, it returns defaultValue. |
| GetShort(key, defaultValue) | Retrieves a value of short type. If the data cannot be retrieved, it returns defaultValue. |
| GetUShort(key, defaultValue) | Retrieves a value of ushort 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. |
| GetUInt(key, defaultValue) | Retrieves a value of uint type. If the data cannot be retrieved, it returns defaultValue. |
| GetLong(key, defaultValue) | Retrieves a value of long type. If the data cannot be retrieved, it returns defaultValue. |
| GetULong(key, defaultValue) | Retrieves a value of ulong type. If the data cannot be retrieved, it returns defaultValue. |
| GetChar(key, defaultValue) | Retrieves a value of char 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. |
| GetDouble(key, defaultValue) | Retrieves a value of double type. If the data cannot be retrieved, it returns defaultValue. |
| GetDecimal(key, defaultValue) | Retrieves a value of decimal 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
}
}
