Beispiel #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 "Copy":
            case "Paste":
            case "SelectAll":
                Event.current.Use();
                break;
            }
        }

        if (Event.current.type == EventType.ExecuteCommand)
        {
            switch (Event.current.commandName)
            {
            case "UndoRedoPerformed":
                FsmEditor.UndoRedoPerformed();
                break;

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

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

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

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

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

            case "OpenFsmSelectorWindow":
                fsmSelectorWindow = GetWindow <FsmSelectorWindow>();
                fsmSelectorWindow.ShowUtility();
                break;

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

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

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

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

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

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

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

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

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

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

            case "RepaintAll":
                RepaintAllWindows();
                break;

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

            GUIUtility.ExitGUI();
        }
    }
Beispiel #2
0
    public void OnGUI()
    {
        fsmEditor.OnGUI();

/*		BeginWindows();
 *
 *              fsmEditor.DoPopupWindows();
 *
 *              EndWindows();*/

        if (Event.current.type == EventType.ValidateCommand)
        {
            //Debug.Log(Event.current.commandName);

            switch (Event.current.commandName)
            {
            case "UndoRedoPerformed":
                FsmEditor.UndoRedoPerformed();
                break;

            case "Copy":
                EditorCommands.CopyStateSelection();
                break;

            case "Paste":
                EditorCommands.PasteStates();
                break;
            }
        }

        if (Event.current.type == EventType.ExecuteCommand)
        {
            //Debug.Log(Event.current.commandName);

            switch (Event.current.commandName)
            {
            case "OpenToolWindow":
                toolWindow = GetWindow <ContextToolWindow>();
                break;

            case "OpenFsmSelectorWindow":
                fsmSelectorWindow = GetWindow <FsmSelectorWindow>();
                fsmSelectorWindow.ShowUtility();
                break;

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

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

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

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

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

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

            case "AddFsmComponent":
                AddFsmToSelected();
                break;

            case "RepaintAll":
                RepaintAllWindows();
                break;
            }

            GUIUtility.ExitGUI();
        }
    }