Exemple #1
0
 private void DoBottomPanel()
 {
     SkillEditorGUILayout.Divider(new GUILayoutOption[0]);
     if (this.selectedTemplate == null)
     {
         EditorGUI.BeginDisabledGroup(true);
         GUILayout.TextField(Strings.get_Label_Category___(), new GUILayoutOption[0]);
         EditorGUILayout.TextArea(Strings.get_Label_Description___(), new GUILayoutOption[]
         {
             GUILayout.MinHeight(44f)
         });
         EditorGUI.EndDisabledGroup();
     }
     else
     {
         EditorGUI.BeginChangeCheck();
         this.selectedTemplate.set_Category(EditorGUILayout.TextField(this.selectedTemplate.get_Category(), new GUILayoutOption[0]));
         this.selectedTemplate.fsm.set_Description(EditorGUILayout.TextArea(this.selectedTemplate.fsm.get_Description(), SkillEditorStyles.TextArea, new GUILayoutOption[]
         {
             GUILayout.MinHeight(44f)
         }));
         if (EditorGUI.EndChangeCheck())
         {
             EditorUtility.SetDirty(this.selectedTemplate);
             Templates.InitList();
         }
         if (this.eventType != 12 && this.currentEvent.get_clickCount() == 2 && SkillEditor.SelectedTemplate != this.selectedTemplate)
         {
             SkillTemplateSelector.AddTemplateToFsm();
             this.currentEvent.Use();
         }
     }
     if (GUILayout.Button(Strings.get_Label_New_Template(), new GUILayoutOption[0]))
     {
         SkillTemplate template = SkillBuilder.CreateTemplate();
         this.SelectTemplate(template);
         base.Repaint();
     }
     if (GUILayout.Button(Strings.get_Label_Load_All_Templates(), new GUILayoutOption[0]))
     {
         Templates.LoadAll();
         base.Repaint();
     }
 }
        public static void DoSelectTemplateMenu(SkillTemplate SelectedTemplate, GenericMenu.MenuFunction ClearTemplate, GenericMenu.MenuFunction2 SelectTemplate)
        {
            Templates.LoadAll();
            List <string> list        = new List <string>();
            GenericMenu   genericMenu = new GenericMenu();

            genericMenu.AddItem(new GUIContent(Strings.get_Menu_None()), false, ClearTemplate);
            using (List <SkillTemplate> .Enumerator enumerator = Templates.List.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    SkillTemplate current = enumerator.get_Current();
                    string        text    = current.get_Category() + "/" + current.get_name();
                    string        text2   = Labels.GenerateUniqueLabelWithNumber(list, text);
                    list.Add(text);
                    genericMenu.AddItem(new GUIContent(text2), SelectedTemplate == current, SelectTemplate, current);
                }
            }
            genericMenu.ShowAsContext();
        }
Exemple #3
0
 public static void LoadAllTemplates()
 {
     Templates.LoadAll();
 }