Skip to content

Commit

Permalink
Repaint editor GUIs on shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerbarton committed Mar 21, 2020
1 parent 0b77423 commit 1d497da
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
12 changes: 12 additions & 0 deletions scripts/Editor/DllManipulatorEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ static string GetFirstAssemblyToList(string[] allAssemblies)
public static void LoadAllShortcut()
{
DllManipulator.LoadAll();
RepaintAll();
DllManipulatorWindowEditor.RepaintAll();
}

#if UNITY_2019_1_OR_NEWER
Expand All @@ -338,6 +340,16 @@ public static void LoadAllShortcut()
public static void UnloadAll()
{
DllManipulator.UnloadAll();
RepaintAll();
DllManipulatorWindowEditor.RepaintAll();
}

public static void RepaintAll()
{
var editors = Resources.FindObjectsOfTypeAll<DllManipulatorEditor>();
if(editors == null) return;
foreach (var editor in editors)
editor.Repaint();
}
}
}
9 changes: 8 additions & 1 deletion scripts/Editor/DllManipulatorWindowEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,20 @@ namespace UnityNativeTool.Internal
{
public class DllManipulatorWindowEditor : EditorWindow
{
private static EditorWindow window;

[MenuItem("Window/Dll manipulator")]
static void Init()
{
var window = GetWindow<DllManipulatorWindowEditor>();
window = GetWindow<DllManipulatorWindowEditor>();
window.Show();
}

public static void RepaintAll()
{
if(window) window.Repaint();
}

void OnGUI()
{
var dllManipulator = FindObjectOfType<DllManipulatorScript>();
Expand Down

0 comments on commit 1d497da

Please sign in to comment.