public void Save() { UnfinityEditorPrefs.SetInt("u2dex_versionNumber", versionNumber); UnfinityEditorPrefs.SetBool("u2dex_transformInspectorEnabled", transformInspectorEnabled); UnfinityEditorPrefs.SetBool("u2dex_enableSnapping", enableSnapping); UnfinityEditorPrefs.SetBool("u2dex_foldoutOpen", foldoutOpen); UnfinityEditorPrefs.SetFloat("u2dex_amountToSnapTo", amountToSnapTo); UnfinityEditorPrefs.SetBool("u2dex_foldoutOpen", snapToGrid); UnfinityEditorPrefs.SetStringArray("u2dex_applicableClasses", applicableClasses); //We only want set our string array if we have any values to set. //Without this check, UnfinityEditorPrefs can throw an error, if there's no data to save. if (disabledClasses.Count > 0) { UnfinityEditorPrefs.SetStringArray("u2dex_disabledClasses", disabledClasses.ToArray()); } else { //If we don't have any data to save, we need to check if we already have a key for our //disabled classes. //If we do, the user has probably cleared the disabled classes list, so we need to delete our //EditorPrefs key so there are no disabled classes to load from on the next load (as the user deleted them). if (EditorPrefs.HasKey("u2dex_disabledClasses")) { EditorPrefs.DeleteKey("u2dex_disabledClasses"); } } UnfinityEditorPrefs.SetVector2("u2dex_gridSize", gridSize); UnfinityEditorPrefs.SetColor("u2dex_gridColor", gridColor); UnfinityEditorPrefs.SetInt("u2dex_gridScale", gridScale); UnfinityEditorPrefs.SetBool("u2dex_usePixelsPerMeter", usePixelsPerMeter); UnfinityEditorPrefs.SetFloat("u2dex_pixelsPerMeter", pixelsPerMeter); UnfinityEditorPrefs.SetBool("u2dex_useNGUIInspector", useNGUIInspector); }