Пример #1
0
 public void UpdateUseCount()
 {
     if (EditorApplication.get_isPlayingOrWillChangePlaymode())
     {
         return;
     }
     this.usageCount.Clear();
     this.unusedEvents.Clear();
     using (List <SkillEvent> .Enumerator enumerator = SkillEvent.get_EventList().GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             SkillEvent current = enumerator.get_Current();
             int        num     = GlobalEventsWindow.CountEventUsage(current);
             this.usageCount.Add(current, num);
             if (num == 0 && !current.get_IsSystemEvent())
             {
                 this.unusedEvents.Add(current);
             }
         }
     }
 }
Пример #2
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();
            }
        }