예제 #1
0
 private void RemoveLocalVariable(SkillVariable variable)
 {
     SkillVariable.DeleteVariable(SkillEditor.SelectedFsm.get_Variables(), variable);
     SkillEditor.SelectedFsm.Reinitialize();
     SkillEditor.SetFsmDirty();
     this.Reset();
     GlobalVariablesWindow.ResetView();
 }
        public override void Initialize()
        {
            this.isToolWindow = true;
            GlobalVariablesWindow.instance = this;
            this.InitWindowTitle();
            base.set_minSize(new Vector2(200f, 200f));
            this.fsmVariablesEditor = new FsmVariablesEditor(this, SkillVariables.get_GlobalsComponent());
            FsmVariablesEditor expr_3F = this.fsmVariablesEditor;

            expr_3F.SettingsButtonClicked = (EditorApplication.CallbackFunction)Delegate.Combine(expr_3F.SettingsButtonClicked, new EditorApplication.CallbackFunction(this.DoSettingsMenu));
            FsmVariablesEditor expr_66 = this.fsmVariablesEditor;

            expr_66.VariableContextClicked = (FsmVariablesEditor.ContextClickVariable)Delegate.Combine(expr_66.VariableContextClicked, new FsmVariablesEditor.ContextClickVariable(GlobalVariablesWindow.DoVariableContextMenu));
        }
예제 #3
0
        private static void RestoreVariables(SkillLogEntry logEntry)
        {
            if (logEntry == null)
            {
                Debug.Log("Bad Log Entry!");
                return;
            }
            Skill fsm = logEntry.get_Fsm();

            if (!fsm.EnableDebugFlow)
            {
                return;
            }
            if (fsm == null)
            {
                Debug.Log("Fsm == null!!");
                return;
            }
            if (logEntry.get_FsmVariablesCopy() != null)
            {
                fsm.get_Variables().ApplyVariableValues(logEntry.get_FsmVariablesCopy());
            }
            else
            {
                Debug.LogError("Missing Local Variables Cache!");
            }
            if (logEntry.get_GlobalVariablesCopy() != null)
            {
                SkillVariables.get_GlobalVariables().ApplyVariableValues(logEntry.get_GlobalVariablesCopy());
            }
            else
            {
                Debug.LogError("Missing global Variables Cache!");
            }
            if (SkillEditor.SelectedFsm == fsm)
            {
                SkillEditor.VariableManager.UpdateView();
                GlobalVariablesWindow.UpdateView();
                SkillEditor.Repaint(false);
            }
        }
예제 #4
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":
                    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 "OpenTimelineWindow":
                    timelineWindow = GetWindow <FsmTimelineWindow>();
                    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();
            }
        }