ProjectPreferences.Set Method

Definition

Overloads

Set(String, Boolean, Boolean)

Save bool to preferences and save to ScriptableObject with key given.

Set(String, Int32, Boolean)

Save int to preferences and save to ScriptableObject with key given.

Set(String, Single, Boolean)

Save float to preferences and save to ScriptableObject with key given.

Set(String, String, Boolean)

Save string to preferences and save to ScriptableObject with key given.

Set(String, Boolean, Boolean)

Save bool to preferences and save to ScriptableObject with key given.

C#
public static void Set (string key, bool value, bool forceSave = true);

Parameters

key
String
value
Boolean
forceSave
Boolean

Remarks

If forceSave is true (default), then will call AssetDatabase.SaveAssets which saves all assets after execution

Applies to

MRTK2 Unity 2018 2.7.0 otras versiones
Producto Versiones
MRTK2 Unity 2018 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2019 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0
MRTK2 Unity 2020 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0

Set(String, Int32, Boolean)

Save int to preferences and save to ScriptableObject with key given.

C#
public static void Set (string key, int value, bool forceSave = true);

Parameters

key
String
value
Int32
forceSave
Boolean

Remarks

If forceSave is true (default), then will call AssetDatabase.SaveAssets which saves all assets after execution

Applies to

MRTK2 Unity 2018 2.7.0 otras versiones
Producto Versiones
MRTK2 Unity 2018 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2019 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0
MRTK2 Unity 2020 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0

Set(String, Single, Boolean)

Save float to preferences and save to ScriptableObject with key given.

C#
public static void Set (string key, float value, bool forceSave = true);

Parameters

key
String
value
Single
forceSave
Boolean

Remarks

If forceSave is true (default), then will call AssetDatabase.SaveAssets which saves all assets after execution

Applies to

MRTK2 Unity 2018 2.7.0 otras versiones
Producto Versiones
MRTK2 Unity 2018 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2019 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0
MRTK2 Unity 2020 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0

Set(String, String, Boolean)

Save string to preferences and save to ScriptableObject with key given.

C#
public static void Set (string key, string value, bool forceSave = true);

Parameters

key
String
value
String
forceSave
Boolean

Remarks

If forceSave is true (default), then will call AssetDatabase.SaveAssets which saves all assets after execution

Applies to

MRTK2 Unity 2018 2.7.0 otras versiones
Producto Versiones
MRTK2 Unity 2018 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2019 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0
MRTK2 Unity 2020 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0