public static ShortcutProviderProxy GetInstance() { if (s_ShortcutProviderProxy == null) { s_ShortcutProviderProxy = new ShortcutProviderProxy(); ToolShortcutDiscoveryProvider.GetInstance().Proxy = s_ShortcutProviderProxy; } return(s_ShortcutProviderProxy); }
internal static void RegisterDefaultShortcutsForBlackboard <T>(string toolName) { ShortcutProviderProxy.GetInstance().AddTool(toolName, typeof(T), BlackboardShortcutFilter); }
/// <summary> /// Registers all GTF provided shortcuts for tool <paramref name="toolName"/>. /// </summary> /// <param name="toolName">The name of the tool that wants to use the shortcuts.</param> /// <param name="shortcutFilter">A function used to filter shortcuts. It receives a shortcut /// id and it should return false if the shortcut is not wanted by the tool. If null, no filtering occurs.</param> /// <param name="registerNow">Set to true to force the immediate discovery of the shortcuts by the /// <see cref="ShortcutManager"/>. You need to set this to true if you register shortcuts after the /// ShortcutManager has been initialized.</param> /// <typeparam name="T">The window type of the tool.</typeparam> public static void RegisterDefaultShortcuts <T>(string toolName, Func <string, bool> shortcutFilter = null, bool registerNow = false) where T : EditorWindow { ShortcutProviderProxy.GetInstance().AddTool(toolName, typeof(T), shortcutFilter, registerNow); }