[Unity]Unity Editor Extensions – Menu Items
參考來源: https://unity3d.com/learn/tutorials/topics/interface-essentials/unity-editor-extensions-menu-items Adding Menu Items 1 2 3 4 5 6 7 public class MenuItems : MonoBehaviour { [MenuItem("TopTools/Find")] private static void doSomething() { Debug.Log("Find"); } } 1 2 3 4 5 6 7 public class MenuItems : MonoBehaviour { [MenuItem("Window/Find")] private static void doSomething() { Debug.Log("Find"); } } Hotkeys 以下是支援的熱鍵(也可以互相合併): % – CTRL on Windows / CMD on OSX # – Shift & – Alt LEFT/RIGHT/UP/DOWN – Arrow keys F1…F2 – F keys HOME, END, PGUP, PGDN 1 2 3 4 5 6 7 8 9 10 11 12 13 14 // Add a new menu item with hotkey CTRL-SHIFT-A [MenuItem("Tools/Find %#a...