public static void SaveFsmAsTemplate() { SkillTemplate fsmTemplate = SkillBuilder.CreateTemplate(SkillEditor.SelectedFsm); if (fsmTemplate != null && SkillEditor.SelectedFsmComponent != null && Dialogs.YesNoDialog(Strings.get_Dialog_Save_Template(), Strings.get_Dialog_Use_Saved_Template_in_this_FSM())) { SkillEditor.SelectedFsmComponent.SetFsmTemplate(fsmTemplate); SkillEditor.Inspector.SetMode(InspectorMode.FsmInspector); } }
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(); } }