예제 #1
0
        public static void InitializeWindow(string title, CommandManager commandManager, bool clearInput = false)
        {
            if (inProgressCommand_ != null)
            {
                Debug.LogWarning("CommandPaletteWindow: Failed to open because of inProgressCommand_!");
                return;
            }

            if (commandManager == null)
            {
                Debug.LogError("CommandPaletteWindow: Can't initialize a window without a command manager!");
                return;
            }

            if (clearInput)
            {
                input_ = "";
            }

            EditorWindow window = EditorWindow.GetWindow(typeof(CommandPaletteWindow), utility: true, title: title, focus: true);

            window.position = new Rect(0.0f, 0.0f, kWindowWidth, kWindowHeight);
            window.CenterInMainEditorWindow();
            window.wantsMouseMove = true;

            selectedIndex_ = 0;
            focusTrigger_  = true;
            isClosing_     = false;

            commandManager_ = commandManager;
            ReloadObjects();
        }
예제 #2
0
        // PRAGMA MARK - Public Interface
        public static void Show(string title, Action <string> argumentCallback, Action cancelCallback = null)
        {
            cancelCallback_   = cancelCallback;
            argumentCallback_ = argumentCallback;

            input_ = "";

            EditorWindow window = EditorWindow.GetWindow(typeof(CommandPaletteArgumentWindow), utility: true, title: title, focus: true);

            window.position = new Rect(0.0f, 0.0f, kWindowWidth, kWindowHeight);
            window.CenterInMainEditorWindow();
            window.wantsMouseMove = true;

            focusTrigger_ = true;
            isClosing_    = false;
        }