Legacy Documentation: Version 5.3
LanguageEnglish
  • C#
  • JS

Script language

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

EditorPrefs.GetInt

public static int GetInt(string key, int defaultValue = 0);

Parameters

Description

Returns the value corresponding to key in the preference file if it exists.

If the value doesn't already exist in the preference file the function will return defaultValue. See Also: SetInt.