示例#1
0
        static void InitializeController()
        {
            var shortcutProviders = new IDiscoveryShortcutProvider[]
            {
                new ShortcutAttributeDiscoveryProvider(),
                new ShortcutMenuItemDiscoveryProvider(),
            };
            var bindingValidator       = new BindingValidator();
            var invalidContextReporter = new DiscoveryInvalidShortcutReporter();
            var discovery = new Discovery(shortcutProviders, bindingValidator, invalidContextReporter);

            instance = new ShortcutController(discovery, bindingValidator, new ShortcutProfileStore(), new LastUsedProfileIdProvider());
            instance.trigger.invokingAction += OnInvokingAction;
        }
        static void InitializeController()
        {
            var shortcutProviders = new IDiscoveryShortcutProvider[]
            {
                new ShortcutAttributeDiscoveryProvider(),
                new ShortcutMenuItemDiscoveryProvider()
            };
            var             bindingValidator       = new BindingValidator();
            var             invalidContextReporter = new DiscoveryInvalidShortcutReporter();
            var             discovery      = new Discovery(shortcutProviders, bindingValidator, invalidContextReporter);
            IContextManager contextManager = new ContextManager();

            s_Instance = new ShortcutController(discovery, contextManager, bindingValidator, new ShortcutProfileStore(), new LastUsedProfileIdProvider());
            s_Instance.trigger.invokingAction += OnInvokingAction;

            EditorApplication.globalEventHandler += EventHandler;
            EditorApplication.doPressedKeysTriggerAnyShortcut += HasAnyEntriesHandler;
            EditorApplication.focusChanged += OnFocusChanged;
        }