Skip to content

Commit 0ca6932

Browse files
committed
chore
1 parent db30908 commit 0ca6932

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Editor/Attributes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace SatorImaging.UnitySourceGenerator
77
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
88
public sealed class UnitySourceGeneratorAttribute : Attribute
99
{
10-
Type generatorClass;
10+
readonly Type generatorClass;
1111

1212
public UnitySourceGeneratorAttribute(Type generatorClass = null)
1313
{

Editor/EditorExtension.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ static void InitializeFocusChangedEvent()
6565
focusAction += OnEditorApplicationFocus;
6666
focusChanged.SetValue(null, focusAction);
6767
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);
7070
}
7171
7272
const string PREF_AUTO_REFRESH = "kAutoRefreshMode";
@@ -79,19 +79,19 @@ static void OnEditorApplicationFocus(bool focus)
7979
//https://github.com/Unity-Technologies/UnityCsReference/blob/master/Editor/Mono/PreferencesWindow/AssetPipelinePreferences.cs#L94
8080
if (focus == false)
8181
{
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);
8484
//AssetDatabase.DisallowAutoRefresh();
8585
EditorApplication.LockReloadAssemblies();
86-
EditorPrefs.GetBool(PREF_DIR_MONITORING, false);
86+
EditorPrefs.SetBool(PREF_DIR_MONITORING, false);
8787
EditorPrefs.SetInt(PREF_AUTO_REFRESH, 0);
8888
EditorPrefs.SetInt(PREF_AUTO_REFRESH_OLD, 0);
8989
}
9090
else
9191
{
9292
//AssetDatabase.AllowAutoRefresh();
9393
EditorApplication.UnlockReloadAssemblies();
94-
EditorPrefs.GetBool(PREF_DIR_MONITORING, s_restoreDirMonitoring);
94+
EditorPrefs.SetBool(PREF_DIR_MONITORING, s_restoreDirMonitoring);
9595
EditorPrefs.SetInt(PREF_AUTO_REFRESH, s_restoreAutoRefresh);
9696
EditorPrefs.SetInt(PREF_AUTO_REFRESH_OLD, s_restoreAutoRefresh);
9797

0 commit comments

Comments
 (0)