RaptorPrefs
Editor preferences for RAPTOR and its modules.
| Namespace | Assembly | Kind | Stability |
|---|---|---|---|
Raptor.EditorTools | Raptor.Editor | class | preview, since 0.1.0 |
Reads and writes EditorPrefs. When the project has a scope file (ScopeFileName), keys are scoped to the project. Otherwise keys are used as given.
public static class RaptorPrefsMethods
GetBool
public static bool GetBool(string key)Reads a bool preference, or false when unset.
| Parameter | Type | Description |
|---|---|---|
key | string | The preference key. |
Returns: The value, or false.
GetBool
public static bool GetBool(string key, bool defaultValue)Reads a bool preference, or defaultValue when unset.
| Parameter | Type | Description |
|---|---|---|
key | string | The preference key. |
defaultValue | bool | What to return when the key is unset. |
Returns: The value, or the default.
GetFloat
public static float GetFloat(string key)Reads a float preference, or 0 when unset.
| Parameter | Type | Description |
|---|---|---|
key | string | The preference key. |
Returns: The value, or 0.
GetFloat
public static float GetFloat(string key, float defaultValue)Reads a float preference, or defaultValue when unset.
| Parameter | Type | Description |
|---|---|---|
key | string | The preference key. |
defaultValue | float | What to return when the key is unset. |
Returns: The value, or the default.
GetInt
public static int GetInt(string key)Reads an int preference, or 0 when unset.
| Parameter | Type | Description |
|---|---|---|
key | string | The preference key. |
Returns: The value, or 0.
GetInt
public static int GetInt(string key, int defaultValue)Reads an int preference, or defaultValue when unset.
| Parameter | Type | Description |
|---|---|---|
key | string | The preference key. |
defaultValue | int | What to return when the key is unset. |
Returns: The value, or the default.
GetString
public static string GetString(string key)Reads a string preference, or an empty string when unset.
| Parameter | Type | Description |
|---|---|---|
key | string | The preference key. |
Returns: The value, or an empty string.
GetString
public static string GetString(string key, string defaultValue)Reads a string preference, or defaultValue when unset.
| Parameter | Type | Description |
|---|---|---|
key | string | The preference key. |
defaultValue | string | What to return when the key is unset. |
Returns: The value, or the default.
SetBool
public static void SetBool(string key, bool value)Stores a bool preference.
| Parameter | Type | Description |
|---|---|---|
key | string | The preference key. |
value | bool | The value to store. |
SetFloat
public static void SetFloat(string key, float value)Stores a float preference.
| Parameter | Type | Description |
|---|---|---|
key | string | The preference key. |
value | float | The value to store. |
SetInt
public static void SetInt(string key, int value)Stores an int preference.
| Parameter | Type | Description |
|---|---|---|
key | string | The preference key. |
value | int | The value to store. |
SetString
public static void SetString(string key, string value)Stores a string preference.
| Parameter | Type | Description |
|---|---|---|
key | string | The preference key. |
value | string | The value to store. |