From 43c1411d09b3df1137f5a08d14798637a6af4700 Mon Sep 17 00:00:00 2001 From: Roger Barton Date: Sat, 21 Mar 2020 15:15:27 +0100 Subject: [PATCH] Use callback attributes to repaint editors This would not work with the `upm-support` branch #14 as the attributes are not searched for in the attribute that these scripts are in by default. --- scripts/Editor/DllManipulatorEditor.cs | 6 ++---- scripts/Editor/DllManipulatorWindowEditor.cs | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/Editor/DllManipulatorEditor.cs b/scripts/Editor/DllManipulatorEditor.cs index 6f400df..4735a51 100644 --- a/scripts/Editor/DllManipulatorEditor.cs +++ b/scripts/Editor/DllManipulatorEditor.cs @@ -336,8 +336,6 @@ static string GetFirstAssemblyToList(string[] allAssemblies) public static void LoadAllShortcut() { DllManipulator.LoadAll(); - RepaintAll(); - DllManipulatorWindowEditor.RepaintAll(); } #if UNITY_2019_1_OR_NEWER @@ -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(); diff --git a/scripts/Editor/DllManipulatorWindowEditor.cs b/scripts/Editor/DllManipulatorWindowEditor.cs index d275ef8..74a17f6 100644 --- a/scripts/Editor/DllManipulatorWindowEditor.cs +++ b/scripts/Editor/DllManipulatorWindowEditor.cs @@ -15,6 +15,8 @@ static void Init() window.Show(); } + [NativeDllLoadedTrigger] + [NativeDllAfterUnloadTrigger] public static void RepaintAll() { if(window) window.Repaint();