Skip to content

Commit bc9f1fa

Browse files
authored
Add keyboard shortcuts to LoadAll and UnloadAll (#10)
1 parent 96c3d45 commit bc9f1fa

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

scripts/DllManipulator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Reflection;

scripts/Editor/DllManipulatorEditor.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
using UnityEngine;
44
using UnityEditor;
55
using UnityEditor.Compilation;
6+
#if UNITY_2019_1_OR_NEWER
7+
using UnityEditor.ShortcutManagement;
8+
#endif
69
using System.IO;
710
using System;
811

@@ -310,5 +313,25 @@ static string GetFirstAssemblyToList(string[] allAssemblies)
310313
return allAssemblies.FirstOrDefault(a => PathUtils.DllPathsEqual(a, typeof(DllManipulator).Assembly.Location))
311314
?? allAssemblies.FirstOrDefault();
312315
}
316+
317+
#if UNITY_2019_1_OR_NEWER
318+
[Shortcut("Tools/Load All Dlls", KeyCode.D, ShortcutModifiers.Alt | ShortcutModifiers.Shift)]
319+
#else
320+
[MenuItem("Tools/Load All Dlls #&d")]
321+
#endif
322+
public static void LoadAllShortcut()
323+
{
324+
DllManipulator.LoadAll();
325+
}
326+
327+
#if UNITY_2019_1_OR_NEWER
328+
[Shortcut("Tools/Unload All Dlls", KeyCode.D, ShortcutModifiers.Alt)]
329+
#else
330+
[MenuItem("Tools/Unload All Dlls &d")]
331+
#endif
332+
public static void UnloadAll()
333+
{
334+
DllManipulator.UnloadAll();
335+
}
313336
}
314337
}

0 commit comments

Comments
 (0)