Skip to content

Commit 0b8a082

Browse files
author
Tom Kail
committed
Fix
1 parent 08ba746 commit 0b8a082

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

Packages/Ink/Editor/Core/Compiler/InkCompiler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ private static void Update () {
117117

118118
static void RemoveCompilingFile (int index) {
119119
InkLibrary.Instance.compilationStack.RemoveAt(index);
120-
InkLibrary.SetDirty();
120+
InkLibrary.SetDirtyAndRepaint();
121121
// Progress bar prevents delayCall callback from firing in Linux Editor, locking the
122122
// compilation until it times out. Let's just not show progress bars in Linux Editor
123123
#if !UNITY_EDITOR_LINUX
@@ -251,7 +251,7 @@ private static void CompileInkInternal (InkFile inkFile, bool immediate) {
251251
};
252252

253253
InkLibrary.Instance.compilationStack.Add(pendingFile);
254-
InkLibrary.SetDirty();
254+
InkLibrary.SetDirtyAndRepaint();
255255

256256
TryCompileNextFileInStack();
257257
}
@@ -415,7 +415,7 @@ private static void DelayedComplete () {
415415
}
416416

417417
InkLibrary.Instance.compilationStack.Clear();
418-
InkLibrary.SetDirty();
418+
InkLibrary.SetDirtyAndRepaint();
419419
InkMetaLibrary.Save();
420420

421421
#if !UNITY_EDITOR_LINUX

Packages/Ink/Editor/Core/Ink Library/InkLibrary.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public static void Rebuild () {
211211
InkMetaLibrary.RebuildInkFileConnections();
212212

213213
foreach (InkFile inkFile in Instance.inkLibrary) inkFile.FindCompiledJSONAsset();
214-
Save();
214+
SetDirtyAndRepaint();
215215
AssetDatabase.SaveAssets();
216216

217217
Debug.Log("Ink Library was rebuilt.");
@@ -241,7 +241,7 @@ private static string[] GetAllInkFilePaths () {
241241
return inkFilePaths;
242242
}
243243

244-
public static void SetDirty () {
244+
public static void SetDirtyAndRepaint () {
245245
EditorUtility.SetDirty(Instance);
246246
EditorApplication.RepaintProjectWindow();
247247
}

Packages/Ink/Editor/Core/Ink Library/InkLibraryEditor.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ public override void OnInspectorGUI() {
5555
serializedObject.Update();
5656

5757

58+
EditorGUILayout.Toggle("HasLockedUnityCompilation", InkCompiler.hasLockedUnityCompilation);
59+
if(GUILayout.Button("Unlock")) {
60+
EditorApplication.UnlockReloadAssemblies();
61+
}
62+
#if UNITY_2019_4_OR_NEWER
63+
if(GUILayout.Button("AllowAutoRefresh")) {
64+
AssetDatabase.AllowAutoRefresh();
65+
}
66+
#endif
67+
5868
if(InkCompiler.compiling) {
5969
Rect r = EditorGUILayout.BeginVertical();
6070
EditorGUI.ProgressBar(r, InkCompiler.GetEstimatedCompilationProgress(), "Compiling...");
@@ -95,6 +105,7 @@ public override void OnInspectorGUI() {
95105
EditorGUILayout.PropertyField(serializedObject.FindProperty("inkLibrary"), true);
96106
EditorGUILayout.PropertyField(serializedObject.FindProperty("pendingCompilationStack"), true);
97107
EditorGUILayout.PropertyField(serializedObject.FindProperty("compilationStack"), true);
108+
EditorGUILayout.PropertyField(serializedObject.FindProperty("disallowedAutoRefresh"), true);
98109
EditorGUI.EndDisabledGroup();
99110

100111
if(GUI.changed && target != null)

0 commit comments

Comments
 (0)