Legacy Documentation: Version 5.2
LanguageEnglish
  • C#
  • JS

Script language

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

EditorPrefs

class in UnityEditor

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual

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 as an integer.
SetStringSets the value of the preference identified by key.