EditorPrefs.SetBool("myBoolPreference", true);
bool showGameObject = EditorPrefs.GetBool("showGameObjectPreference"); if (showGameObject) { gameObject.SetActive(true); } else { gameObject.SetActive(false); }In this example, we are retrieving a boolean value called "showGameObjectPreference" from the editor preferences. If the value is true, we are showing the game object, otherwise we are hiding it. The package library for EditorPrefs is UnityEngine.