Get RAPTOR

RaptorPrefs

Editor preferences for RAPTOR and its modules.

NamespaceAssemblyKindStability
Raptor.EditorToolsRaptor.Editorclasspreview, 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 RaptorPrefs

Methods

GetBool

public static bool GetBool(string key)

Reads a bool preference, or false when unset.

ParameterTypeDescription
keystringThe preference key.

Returns: The value, or false.

GetBool

public static bool GetBool(string key, bool defaultValue)

Reads a bool preference, or defaultValue when unset.

ParameterTypeDescription
keystringThe preference key.
defaultValueboolWhat 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.

ParameterTypeDescription
keystringThe preference key.

Returns: The value, or 0.

GetFloat

public static float GetFloat(string key, float defaultValue)

Reads a float preference, or defaultValue when unset.

ParameterTypeDescription
keystringThe preference key.
defaultValuefloatWhat 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.

ParameterTypeDescription
keystringThe preference key.

Returns: The value, or 0.

GetInt

public static int GetInt(string key, int defaultValue)

Reads an int preference, or defaultValue when unset.

ParameterTypeDescription
keystringThe preference key.
defaultValueintWhat 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.

ParameterTypeDescription
keystringThe 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.

ParameterTypeDescription
keystringThe preference key.
defaultValuestringWhat 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.

ParameterTypeDescription
keystringThe preference key.
valueboolThe value to store.

SetFloat

public static void SetFloat(string key, float value)

Stores a float preference.

ParameterTypeDescription
keystringThe preference key.
valuefloatThe value to store.

SetInt

public static void SetInt(string key, int value)

Stores an int preference.

ParameterTypeDescription
keystringThe preference key.
valueintThe value to store.

SetString

public static void SetString(string key, string value)

Stores a string preference.

ParameterTypeDescription
keystringThe preference key.
valuestringThe value to store.