@@ -65,8 +65,8 @@ static void InitializeFocusChangedEvent()
65
65
focusAction += OnEditorApplicationFocus;
66
66
focusChanged.SetValue(null, focusAction);
67
67
68
- s_restoreAutoRefresh = EditorPrefs.GetInt(PREF_AUTO_REFRESH, EditorPrefs.GetInt(PREF_AUTO_REFRESH_OLD));
69
- s_restoreDirMonitoring = EditorPrefs.GetBool(PREF_DIR_MONITORING);
68
+ s_restoreAutoRefresh = EditorPrefs.GetInt(PREF_AUTO_REFRESH, EditorPrefs.GetInt(PREF_AUTO_REFRESH_OLD, 1 ));
69
+ s_restoreDirMonitoring = EditorPrefs.GetBool(PREF_DIR_MONITORING, true );
70
70
}
71
71
72
72
const string PREF_AUTO_REFRESH = "kAutoRefreshMode";
@@ -79,19 +79,19 @@ static void OnEditorApplicationFocus(bool focus)
79
79
//https://github.com/Unity-Technologies/UnityCsReference/blob/master/Editor/Mono/PreferencesWindow/AssetPipelinePreferences.cs#L94
80
80
if (focus == false)
81
81
{
82
- s_restoreAutoRefresh = EditorPrefs.GetInt(PREF_AUTO_REFRESH, EditorPrefs.GetInt(PREF_AUTO_REFRESH_OLD));
83
- s_restoreDirMonitoring = EditorPrefs.GetBool(PREF_DIR_MONITORING);
82
+ s_restoreAutoRefresh = EditorPrefs.GetInt(PREF_AUTO_REFRESH, EditorPrefs.GetInt(PREF_AUTO_REFRESH_OLD, 1 ));
83
+ s_restoreDirMonitoring = EditorPrefs.GetBool(PREF_DIR_MONITORING, true );
84
84
//AssetDatabase.DisallowAutoRefresh();
85
85
EditorApplication.LockReloadAssemblies();
86
- EditorPrefs.GetBool (PREF_DIR_MONITORING, false);
86
+ EditorPrefs.SetBool (PREF_DIR_MONITORING, false);
87
87
EditorPrefs.SetInt(PREF_AUTO_REFRESH, 0);
88
88
EditorPrefs.SetInt(PREF_AUTO_REFRESH_OLD, 0);
89
89
}
90
90
else
91
91
{
92
92
//AssetDatabase.AllowAutoRefresh();
93
93
EditorApplication.UnlockReloadAssemblies();
94
- EditorPrefs.GetBool (PREF_DIR_MONITORING, s_restoreDirMonitoring);
94
+ EditorPrefs.SetBool (PREF_DIR_MONITORING, s_restoreDirMonitoring);
95
95
EditorPrefs.SetInt(PREF_AUTO_REFRESH, s_restoreAutoRefresh);
96
96
EditorPrefs.SetInt(PREF_AUTO_REFRESH_OLD, s_restoreAutoRefresh);
97
97
0 commit comments