EditorTool add hotkey?
[MenuItem("EditorTools/Hotkeys/CustomTool #W")]
[EditorTool("CustomTool", typeof(CustomModule))]
public class CustomTool : EditorTool
{ ... }
Support to hotkey in EditorTool class?
Comment
Best Answer
Answer by kbop2000 · Jul 14, 2020 at 01:58 AM
this scripts is working
public class CustomTool : EditorTool {
// Shift + W
[MenuItem("Edit/EditorTool/CustomTool #W", validate = false)]
public static void ActiveTool()
{
if (Selection.transforms.Length != 1) return;
if (Selection.transforms[0].GetComponent<CustomModule>() is var comp)
EditorTools.SetActiveTool(typeof(CustomModule));
}
// ...
}
Your answer
Follow this Question
Related Questions
Ubuntu 16.04 LTS with Unity 5.5.0xp1 command line option question 2 Answers
Hierarchy disappears in Unity 5.2 from 4.6.8 1 Answer
How to save a two-dimensional array, as part of the variable inspector? 0 Answers
Change 3rd person controller jump 0 Answers
Is there a way to set targetFramerate within the editor? 0 Answers