Skip to content

Commit

Permalink
Use callback attributes to repaint editors
Browse files Browse the repository at this point in the history
This would not work with the `upm-support` branch mcpiroman#14 as the attributes are not searched for in the attribute that these scripts are in by default.
  • Loading branch information
rogerbarton committed Mar 21, 2020
1 parent 270c46a commit 43c1411
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 2 additions & 4 deletions scripts/Editor/DllManipulatorEditor.cs
Expand Up @@ -336,8 +336,6 @@ static string GetFirstAssemblyToList(string[] allAssemblies)
public static void LoadAllShortcut()
{
DllManipulator.LoadAll();
RepaintAll();
DllManipulatorWindowEditor.RepaintAll();
}

#if UNITY_2019_1_OR_NEWER
Expand All @@ -348,10 +346,10 @@ public static void LoadAllShortcut()
public static void UnloadAll()
{
DllManipulator.UnloadAll();
RepaintAll();
DllManipulatorWindowEditor.RepaintAll();
}

[NativeDllLoadedTrigger]
[NativeDllAfterUnloadTrigger]
public static void RepaintAll()
{
var editors = Resources.FindObjectsOfTypeAll<DllManipulatorEditor>();
Expand Down
2 changes: 2 additions & 0 deletions scripts/Editor/DllManipulatorWindowEditor.cs
Expand Up @@ -15,6 +15,8 @@ static void Init()
window.Show();
}

[NativeDllLoadedTrigger]
[NativeDllAfterUnloadTrigger]
public static void RepaintAll()
{
if(window) window.Repaint();
Expand Down

0 comments on commit 43c1411

Please sign in to comment.