Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

EditorPrefs

Namespace: UnityEditor

Description

Stores and accesses Unity editor preferences.

On Mac OS X, EditorPrefs are stored in ~/Library/Preferences/com.unity3d.UnityEditor.plist.

On Windows, EditorPrefs are stored in the registry under the HKCU\Software\Unity Technologies\UnityEditor key.

Static Functions

DeleteAllRemoves all keys and values from the preferences. Use with caution.
DeleteKeyRemoves key and its corresponding value from the preferences.
GetBoolReturns the value corresponding to key in the preference file if it exists.
GetFloatReturns the value corresponding to key in the preference file if it exists.
GetIntReturns the value corresponding to key in the preference file if it exists.
GetStringReturns the value corresponding to key in the preference file if it exists.
HasKeyReturns true if key exists in the preferences.
SetBoolSets the value of the preference identified by key.
SetFloatSets the value of the preference identified by key.
SetIntSets the value of the preference identified by key.
SetStringSets the value of the preference identified by key.