示例#1
0
        public override void DoGUI()
        {
            fsmEditor.OnGUI();

            /* Debug Repaint events
             * if (Event.current.type == EventType.repaint)
             * {
             *  Debug.Log("Repaint");
             * }*/

            if (Event.current.type == EventType.ValidateCommand)
            {
                switch (Event.current.commandName)
                {
                case "UndoRedoPerformed":
                case "Cut":
                case "Copy":
                case "Paste":
                case "SelectAll":
                    Event.current.Use();
                    break;
                }
            }

            if (Event.current.type == EventType.ExecuteCommand)
            {
                switch (Event.current.commandName)
                {
                /* replaced with Undo.undoRedoPerformed callback added in Unity 4.3
                 * case "UndoRedoPerformed":
                 *  FsmEditor.UndoRedoPerformed();
                 *  break;
                 */

                case "Cut":
                    FsmEditor.Cut();
                    break;

                case "Copy":
                    FsmEditor.Copy();
                    break;

                case "Paste":
                    FsmEditor.Paste();
                    break;

                case "SelectAll":
                    FsmEditor.SelectAll();
                    break;

                case "OpenWelcomeWindow":
                    GetWindow <PlayMakerWelcomeWindow>();
                    break;

                case "OpenToolWindow":
                    GetWindow <ContextToolWindow>();
                    break;

                case "OpenFsmSelectorWindow":
                    GetWindow <FsmSelectorWindow>();
                    break;

                case "OpenFsmTemplateWindow":
                    GetWindow <FsmTemplateWindow>();
                    break;

                case "OpenStateSelectorWindow":
                    GetWindow <FsmStateWindow>();
                    break;

                case "OpenActionWindow":
                    GetWindow <FsmActionWindow>();
                    break;

                case "OpenGlobalEventsWindow":
                    GetWindow <FsmEventsWindow>();
                    break;

                case "OpenGlobalVariablesWindow":
                    GetWindow <FsmGlobalsWindow>();
                    break;

                case "OpenErrorWindow":
                    GetWindow <FsmErrorWindow>();
                    break;

                case "OpenTimelineWindow":
                    GetWindow <FsmTimelineWindow>();
                    break;

                case "OpenFsmLogWindow":
                    GetWindow <FsmLogWindow>();
                    break;

                case "OpenAboutWindow":
                    GetWindow <AboutWindow>();
                    break;

                case "OpenReportWindow":
                    GetWindow <ReportWindow>();
                    break;

                case "AddFsmComponent":
                    PlayMakerMainMenu.AddFsmToSelected();
                    break;

                case "RepaintAll":
                    RepaintAllWindows();
                    break;

                case "ChangeLanguage":
                    ResetWindowTitles();
                    break;
                }

                GUIUtility.ExitGUI();
            }
        }
        public override void DoGUI()
        {
            fsmEditor.OnGUI();

            switch (eventType)
            {
            case EventType.ValidateCommand:
                switch (Event.current.commandName)
                {
                case "Cut":
                case "Copy":
                case "Paste":
                case "SelectAll":
                    Event.current.Use();
                    break;
                }

                break;

            case EventType.ExecuteCommand:
                switch (Event.current.commandName)
                {
                // NOTE: OSX 2018.3 needs Event.current.Use();
                // otherwise e.g., it pastes twice #1814

                case "Cut":
                    FsmEditor.Cut();
                    Event.current.Use();
                    break;

                case "Copy":
                    FsmEditor.Copy();
                    Event.current.Use();
                    break;

                case "Paste":
                    FsmEditor.Paste();
                    Event.current.Use();
                    break;

                case "SelectAll":
                    FsmEditor.SelectAll();
                    Event.current.Use();
                    break;

                case "OpenWelcomeWindow":
                    OpenWindow <PlayMakerWelcomeWindow>();
                    break;

                case "OpenToolWindow":
                    OpenWindow <ContextToolWindow>();
                    break;

                case "OpenFsmSelectorWindow":
                    OpenWindow <FsmSelectorWindow>();
                    break;

                case "OpenFsmTemplateWindow":
                    OpenWindow <FsmTemplateWindow>();
                    break;

                case "OpenStateSelectorWindow":
                    OpenWindow <FsmStateWindow>();
                    break;

                case "OpenActionWindow":
                    OpenWindow <FsmActionWindow>();
                    break;

                case "OpenGlobalEventsWindow":
                    OpenWindow <FsmEventsWindow>();
                    break;

                case "OpenGlobalVariablesWindow":
                    OpenWindow <FsmGlobalsWindow>();
                    break;

                case "OpenErrorWindow":
                    OpenWindow <FsmErrorWindow>();
                    break;

                case "OpenTimelineWindow":
                    OpenWindow <FsmTimelineWindow>();
                    break;

                case "OpenFsmLogWindow":
                    OpenWindow <FsmLogWindow>();
                    break;

                case "OpenAboutWindow":
                    OpenWindow <AboutWindow>();
                    break;

                case "OpenReportWindow":
                    OpenWindow <ReportWindow>();
                    break;

                case "AddFsmComponent":
                    PlayMakerMainMenu.AddFsmToSelected();
                    Event.current.Use();
                    break;

                case "ChangeLanguage":
                    ResetWindowTitles();
                    Event.current.Use();
                    break;

                case "OpenFsmControlsWindow":
                    OpenWindow <FsmControlsWindow>();
                    break;
                }

                GUIUtility.ExitGUI();
                break;
            }
        }