Skip to content

Commit 34a6b01

Browse files
committed
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.
1 parent 88a8895 commit 34a6b01

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

scripts/Editor/DllManipulatorEditor.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,6 @@ static string GetFirstAssemblyToList(string[] allAssemblies)
330330
public static void LoadAllShortcut()
331331
{
332332
DllManipulator.LoadAll();
333-
RepaintAll();
334-
DllManipulatorWindowEditor.RepaintAll();
335333
}
336334

337335
#if UNITY_2019_1_OR_NEWER
@@ -342,10 +340,10 @@ public static void LoadAllShortcut()
342340
public static void UnloadAll()
343341
{
344342
DllManipulator.UnloadAll();
345-
RepaintAll();
346-
DllManipulatorWindowEditor.RepaintAll();
347343
}
348344

345+
[NativeDllLoadedTrigger]
346+
[NativeDllAfterUnloadTrigger]
349347
public static void RepaintAll()
350348
{
351349
var editors = Resources.FindObjectsOfTypeAll<DllManipulatorEditor>();

scripts/Editor/DllManipulatorWindowEditor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ static void Init()
1515
window.Show();
1616
}
1717

18+
[NativeDllLoadedTrigger]
19+
[NativeDllAfterUnloadTrigger]
1820
public static void RepaintAll()
1921
{
2022
if(window) window.Repaint();

0 commit comments

Comments
 (0)