Ejemplo n.º 1
0
 private static void DoFsmSelectorGUI()
 {
     SkillEditorContent.MainToolbarSelectedGO.set_text((SkillEditor.SelectedFsmGameObject == null) ? Strings.get_Label_None() : SkillEditor.SelectedFsmGameObject.get_name());
     SkillEditorContent.MainToolbarSelectedGO.set_tooltip(Strings.get_Hint_Select_Game_Object());
     EditorGUI.BeginDisabledGroup(!SkillEditor.SelectionHistory.CanMoveBack());
     if (GUILayout.Button(SkillEditorContent.BackButton, EditorStyles.get_toolbarButton(), new GUILayoutOption[0]))
     {
         SkillEditor.SelectFsm(SkillEditor.SelectionHistory.MoveBack());
     }
     EditorGUI.EndDisabledGroup();
     EditorGUI.BeginDisabledGroup(!SkillEditor.SelectionHistory.CanMoveForward());
     if (GUILayout.Button(SkillEditorContent.ForwardButton, EditorStyles.get_toolbarButton(), new GUILayoutOption[0]))
     {
         SkillEditor.SelectFsm(SkillEditor.SelectionHistory.MoveForward());
     }
     EditorGUI.EndDisabledGroup();
     EditorGUI.BeginDisabledGroup(SkillEditor.SelectionHistory.RecentlySelectedCount <= 0);
     if (GUILayout.Button(SkillEditorContent.RecentButton, EditorStyles.get_toolbarButton(), new GUILayoutOption[0]))
     {
         GenericMenu  genericMenu          = new GenericMenu();
         List <Skill> recentlySelectedFSMs = SkillEditor.SelectionHistory.GetRecentlySelectedFSMs();
         using (List <Skill> .Enumerator enumerator = recentlySelectedFSMs.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 Skill current = enumerator.get_Current();
                 genericMenu.AddItem(new GUIContent(Labels.GetFullFsmLabel(current)), current == SkillEditor.SelectedFsm, new GenericMenu.MenuFunction2(SkillEditor.SelectFsm), current);
             }
         }
         genericMenu.ShowAsContext();
         return;
     }
     EditorGUI.EndDisabledGroup();
     if (GUILayout.Button(SkillEditorContent.MainToolbarSelectedGO, EditorStyles.get_toolbarDropDown(), new GUILayoutOption[]
     {
         GUILayout.MinWidth(100f)
     }))
     {
         SkillEditorGUILayout.GenerateFsmGameObjectSelectionMenu(true).ShowAsContext();
     }
     SkillEditorContent.MainToolbarSelectedFSM.set_text((SkillEditor.SelectedFsm == null) ? "" : SkillEditor.SelectedFsm.get_Name());
     SkillEditorContent.MainToolbarSelectedFSM.set_tooltip(Strings.get_Tooltip_Select_FSM());
     if (GUILayout.Button(SkillEditorContent.MainToolbarSelectedFSM, EditorStyles.get_toolbarDropDown(), new GUILayoutOption[]
     {
         GUILayout.MinWidth(100f)
     }))
     {
         SkillEditorGUILayout.GenerateGameObjectFsmSelectionMenu().ShowAsContext();
     }
     FsmEditorSettings.LockGraphView = GUILayout.Toggle(FsmEditorSettings.LockGraphView, SkillEditorContent.MainToolbarLock, EditorStyles.get_toolbarButton(), new GUILayoutOption[0]);
     if (GUI.get_changed())
     {
         FsmEditorSettings.SaveSettings();
     }
 }