Skip to content

Commit f9a1313

Browse files
committed
fix: no dir monitoring
1 parent e75da7a commit f9a1313

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Editor/EditorEvent.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ internal static void RegisterFocusChangedEvent(bool registerOrRemove)
2424
//https://github.com/Unity-Technologies/UnityCsReference/blob/master/Editor/Mono/EditorApplication.cs#L275
2525
var focusChanged = typeof(EditorApplication).GetField("focusChanged",
2626
BindingFlags.Static | BindingFlags.NonPublic);
27-
if (focusChanged == null) return;
27+
if (focusChanged == null)
28+
return;
2829

2930
// TODO: better cleanup.
3031
// currently, event can be unregistered but it seems empty action runs on focus changed event...?
@@ -50,32 +51,33 @@ internal static void RegisterFocusChangedEvent(bool registerOrRemove)
5051
//Debug.Log($"[USG] Null? {currentAction == null} Method:{currentAction.Method} Target:{currentAction.Target}");
5152

5253
_restoreAutoRefresh = EditorPrefs.GetInt(PREF_AUTO_REFRESH, EditorPrefs.GetInt(PREF_AUTO_REFRESH_OLD, DEFAULT_AUTO_REFRESH));
53-
_restoreDirMonitoring = EditorPrefs.GetBool(PREF_DIR_MONITORING, DEFAULT_DIR_MONITORING);
54+
//_restoreDirMonitoring = EditorPrefs.GetBool(PREF_DIR_MONITORING, DEFAULT_DIR_MONITORING);
5455
}
5556

5657
const bool DEFAULT_DIR_MONITORING = true;
5758
const int DEFAULT_AUTO_REFRESH = 1;
5859
const string PREF_AUTO_REFRESH = "kAutoRefreshMode";
5960
const string PREF_AUTO_REFRESH_OLD = "kAutoRefresh";
60-
const string PREF_DIR_MONITORING = "DirectoryMonitoring";
61-
static bool _restoreDirMonitoring = DEFAULT_DIR_MONITORING;
61+
//const string PREF_DIR_MONITORING = "DirectoryMonitoring";
62+
//static bool _restoreDirMonitoring = DEFAULT_DIR_MONITORING;
6263
static int _restoreAutoRefresh = DEFAULT_AUTO_REFRESH;
6364
static void OnEditorApplicationFocus(bool focus)
6465
{
6566
//https://github.com/Unity-Technologies/UnityCsReference/blob/master/Editor/Mono/PreferencesWindow/AssetPipelinePreferences.cs#L94
6667
if (focus == false)
6768
{
6869
_restoreAutoRefresh = EditorPrefs.GetInt(PREF_AUTO_REFRESH, EditorPrefs.GetInt(PREF_AUTO_REFRESH_OLD, DEFAULT_AUTO_REFRESH));
69-
_restoreDirMonitoring = EditorPrefs.GetBool(PREF_DIR_MONITORING, DEFAULT_DIR_MONITORING);
70+
//_restoreDirMonitoring = EditorPrefs.GetBool(PREF_DIR_MONITORING, DEFAULT_DIR_MONITORING);
71+
7072
//AssetDatabase.DisallowAutoRefresh();
7173
EditorApplication.LockReloadAssemblies();
72-
EditorPrefs.SetBool(PREF_DIR_MONITORING, false);
74+
//EditorPrefs.SetBool(PREF_DIR_MONITORING, false);
7375
EditorPrefs.SetInt(PREF_AUTO_REFRESH, 0);
7476
EditorPrefs.SetInt(PREF_AUTO_REFRESH_OLD, 0);
7577
}
7678
else
7779
{
78-
EditorPrefs.SetBool(PREF_DIR_MONITORING, _restoreDirMonitoring);
80+
//EditorPrefs.SetBool(PREF_DIR_MONITORING, _restoreDirMonitoring);
7981
EditorPrefs.SetInt(PREF_AUTO_REFRESH, _restoreAutoRefresh);
8082
EditorPrefs.SetInt(PREF_AUTO_REFRESH_OLD, _restoreAutoRefresh);
8183

0 commit comments

Comments
 (0)