private void DoBottomPanel() { SkillEditorGUILayout.Divider(new GUILayoutOption[0]); if (SkillEditor.SelectedFsm != null) { SkillEditor.SelectedFsm.set_Description(EditorGUILayout.TextArea(SkillEditor.SelectedFsm.get_Description(), SkillEditorStyles.TextArea, new GUILayoutOption[] { GUILayout.MinHeight(44f) })); EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]); SkillEditor.SelectedFsm.set_DocUrl(EditorGUILayout.TextField(SkillEditor.SelectedFsm.get_DocUrl(), new GUILayoutOption[0])); if (string.IsNullOrEmpty(SkillEditor.SelectedFsm.get_DocUrl())) { GUI.set_enabled(false); } if (SkillEditorGUILayout.HelpButton("Online Help")) { Application.OpenURL(SkillEditor.SelectedFsm.get_DocUrl()); } EditorGUILayout.EndHorizontal(); } else { GUI.set_enabled(false); GUILayout.TextArea(Strings.get_Label_Description___(), new GUILayoutOption[] { GUILayout.MinHeight(44f) }); EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.TextField(Strings.get_FsmSelector_Label_Url_to_docs(), new GUILayoutOption[0]); SkillEditorGUILayout.HelpButton("Online Help"); EditorGUILayout.EndHorizontal(); } EditorGUILayout.Space(); }
private void DoBottomPanel() { SkillEditorGUILayout.Divider(new GUILayoutOption[0]); if (this.selectedAction != null) { GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.Label(Labels.GetActionLabel(this.selectedAction), SkillEditorStyles.ActionPreviewTitle, new GUILayoutOption[] { GUILayout.MaxWidth(base.get_position().get_width() - 30f) }); GUILayout.FlexibleSpace(); if (SkillEditorGUILayout.HelpButton("Online Help")) { EditorCommands.OpenWikiPage(this.previewAction); } GUILayout.EndHorizontal(); string tooltip = Actions.GetTooltip(this.selectedAction); GUILayout.Box(tooltip, SkillEditorStyles.LabelWithWordWrap, new GUILayoutOption[0]); if (Event.get_current().get_type() == 7) { this.descriptionHeight = GUILayoutUtility.GetLastRect().get_height(); } ActionEditor.PreviewMode = true; EditorGUILayout.Space(); SkillEditorGUILayout.Divider(new GUILayoutOption[0]); if (FsmEditorSettings.ShowActionPreview) { this.DoSelectedActionPreview(); } ActionEditor.PreviewMode = false; } GUILayout.BeginHorizontal(new GUILayoutOption[0]); bool flag = GUILayout.Toggle(FsmEditorSettings.ShowActionPreview, Strings.get_ActionSelector_Preview(), new GUILayoutOption[0]); if (flag != FsmEditorSettings.ShowActionPreview) { FsmEditorSettings.ShowActionPreview = flag; FsmEditorSettings.SaveSettings(); } EditorGUI.BeginDisabledGroup(SkillEditor.SelectedState == null || this.selectedAction == null || FsmGraphView.EditingDisable); if (GUILayout.Button(new GUIContent(Strings.get_ActionSelector_Add_Action_To_State(), Strings.get_ActionSelector_Add_Action_To_State_Tooltip()), new GUILayoutOption[0])) { this.AddSelectedActionToState(); } EditorGUI.EndDisabledGroup(); GUILayout.EndHorizontal(); EditorGUILayout.Space(); }
private void DoBottomPanel() { GUILayout.BeginHorizontal(new GUILayoutOption[0]); bool enabled = GUI.get_enabled(); if (SkillEditor.SelectedFsm == null || this.selectedEvent == null || SkillEditor.SelectedFsm.HasEvent(this.selectedEvent.get_Name())) { GUI.set_enabled(false); } if (GUILayout.Button(Strings.get_Command_Add_Selected_Event_To_FSM(), new GUILayoutOption[0])) { this.AddSelectedEventToState(); } GUI.set_enabled(enabled); if (SkillEditorGUILayout.HelpButton("Online Help")) { EditorCommands.OpenWikiPage(WikiPages.EventBrowser); } GUILayout.EndHorizontal(); EditorGUILayout.Space(); }
public static void OnGUI() { EditorGUI.BeginChangeCheck(); Skill fsm = SkillEditor.SelectedFsm; if (fsm == null) { GUILayout.FlexibleSpace(); return; } if (!FsmInspector.isInitialized) { FsmInspector.isInitialized = true; FsmInspector.Init(); } FsmInspector.scrollViewPosition = GUILayout.BeginScrollView(FsmInspector.scrollViewPosition, new GUILayoutOption[0]); EditorGUI.BeginChangeCheck(); fsm.set_Name(EditorGUILayout.TextField(fsm.get_Name(), new GUILayoutOption[0])); if (EditorGUI.EndChangeCheck()) { Labels.Update(fsm); } if (fsm.get_Owner() != null) { GUILayout.BeginHorizontal(new GUILayoutOption[0]); SkillTemplate fsmTemplate = (SkillTemplate)EditorGUILayout.ObjectField(FsmInspector.SelectedTemplate, typeof(SkillTemplate), false, new GUILayoutOption[0]); if (fsmTemplate != FsmInspector.SelectedTemplate) { FsmInspector.SelectTemplate(fsmTemplate); } if (GUILayout.Button(SkillEditorContent.BrowseTemplateButton, new GUILayoutOption[] { GUILayout.MaxWidth(30f), GUILayout.Height(16f) })) { Templates.DoSelectTemplateMenu(FsmInspector.SelectedTemplate, new GenericMenu.MenuFunction(FsmInspector.ClearTemplate), new GenericMenu.MenuFunction2(FsmInspector.SelectTemplate)); } GUILayout.EndHorizontal(); } EditorGUI.BeginDisabledGroup(!Application.get_isPlaying() && SkillEditor.SelectedFsmUsesTemplate); if (fsm.get_Template() != null) { fsm = fsm.get_Template().fsm; } fsm.set_Description(SkillEditorGUILayout.TextAreaWithHint(fsm.get_Description(), Strings.get_Label_Description___(), new GUILayoutOption[] { GUILayout.MinHeight(80f) })); EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]); fsm.set_DocUrl(SkillEditorGUILayout.TextFieldWithHint(fsm.get_DocUrl(), Strings.get_Tooltip_Documentation_Url(), new GUILayoutOption[0])); EditorGUI.BeginDisabledGroup(!string.IsNullOrEmpty(fsm.get_DocUrl())); if (SkillEditorGUILayout.HelpButton("Online Help")) { Application.OpenURL(fsm.get_DocUrl()); } EditorGUI.EndDisabledGroup(); EditorGUILayout.EndHorizontal(); EditorGUI.BeginDisabledGroup(!Application.get_isPlaying() && SkillEditor.SelectedFsmUsesTemplate); fsm.set_MaxLoopCountOverride(EditorGUILayout.IntField(SkillEditorContent.MaxLoopOverrideLabel, fsm.get_MaxLoopCountOverride(), new GUILayoutOption[0])); fsm.RestartOnEnable = GUILayout.Toggle(fsm.RestartOnEnable, SkillEditorContent.ResetOnDisableLabel, new GUILayoutOption[0]); EditorGUI.EndDisabledGroup(); EditorGUI.EndDisabledGroup(); fsm = SkillEditor.SelectedFsm; SkillEditorGUILayout.LightDivider(new GUILayoutOption[0]); GUILayout.Label(SkillEditorContent.FsmControlsLabel, EditorStyles.get_boldLabel(), new GUILayoutOption[0]); if (fsm.ExposedEvents.get_Count() + FsmInspector.fsmVariables.get_Count() == 0) { SkillEditorGUILayout.DisabledLabel(Strings.get_Label_None_In_Table()); } else { SkillEditorGUILayout.LabelWidth(100f); int num = 0; for (int i = 0; i < FsmInspector.fsmVariables.get_Count(); i++) { SkillVariable fsmVariable = FsmInspector.fsmVariables.get_Item(i); if (fsmVariable.ShowInInspector) { int categoryID = fsmVariable.CategoryID; if (categoryID > 0 && categoryID != num) { num = categoryID; GUILayout.Label(SkillEditor.SelectedFsm.get_Variables().get_Categories()[categoryID], EditorStyles.get_boldLabel(), new GUILayoutOption[0]); SkillEditorGUILayout.LightDivider(new GUILayoutOption[0]); } fsmVariable.DoInspectorGUI(SkillEditorContent.TempContent(fsmVariable.Name, fsmVariable.Name + ((!string.IsNullOrEmpty(fsmVariable.Tooltip)) ? (":\n" + fsmVariable.Tooltip) : "")), false); } } using (List <SkillEvent> .Enumerator enumerator = fsm.ExposedEvents.GetEnumerator()) { while (enumerator.MoveNext()) { SkillEvent current = enumerator.get_Current(); if (GUILayout.Button(current.get_Name(), new GUILayoutOption[0])) { fsm.Event(current); } } } if (GUI.get_changed()) { SkillEditor.RepaintAll(); } } if (FsmEditorSettings.ShowHints) { GUILayout.Box(Strings.get_Hint_Expose_Events_and_Variables(), SkillEditorStyles.HintBox, new GUILayoutOption[0]); } SkillEditorGUILayout.LightDivider(new GUILayoutOption[0]); GUILayout.Label(SkillEditorContent.NetworkSyncLabel, EditorStyles.get_boldLabel(), new GUILayoutOption[0]); int num2 = 0; SkillBool[] boolVariables = fsm.get_Variables().get_BoolVariables(); for (int j = 0; j < boolVariables.Length; j++) { SkillBool fsmBool = boolVariables[j]; if (fsmBool.get_NetworkSync()) { GUILayout.Label(fsmBool.get_Name(), new GUILayoutOption[0]); num2++; } } SkillFloat[] floatVariables = fsm.get_Variables().get_FloatVariables(); for (int k = 0; k < floatVariables.Length; k++) { SkillFloat fsmFloat = floatVariables[k]; if (fsmFloat.get_NetworkSync()) { GUILayout.Label(fsmFloat.get_Name(), new GUILayoutOption[0]); num2++; } } SkillInt[] intVariables = fsm.get_Variables().get_IntVariables(); for (int l = 0; l < intVariables.Length; l++) { SkillInt fsmInt = intVariables[l]; if (fsmInt.get_NetworkSync()) { GUILayout.Label(fsmInt.get_Name(), new GUILayoutOption[0]); num2++; } } SkillQuaternion[] quaternionVariables = fsm.get_Variables().get_QuaternionVariables(); for (int m = 0; m < quaternionVariables.Length; m++) { SkillQuaternion fsmQuaternion = quaternionVariables[m]; if (fsmQuaternion.get_NetworkSync()) { GUILayout.Label(fsmQuaternion.get_Name(), new GUILayoutOption[0]); num2++; } } SkillVector3[] vector3Variables = fsm.get_Variables().get_Vector3Variables(); for (int n = 0; n < vector3Variables.Length; n++) { SkillVector3 fsmVector = vector3Variables[n]; if (fsmVector.get_NetworkSync()) { GUILayout.Label(fsmVector.get_Name(), new GUILayoutOption[0]); num2++; } } if (num2 == 0) { SkillEditorGUILayout.DisabledLabel(Strings.get_Label_None_In_Table()); } if (FsmEditorSettings.ShowHints) { GUILayout.Box(Strings.get_Hint_Network_Sync_Variables(), SkillEditorStyles.HintBox, new GUILayoutOption[0]); } SkillEditorGUILayout.LightDivider(new GUILayoutOption[0]); GUILayout.Label("Debug", EditorStyles.get_boldLabel(), new GUILayoutOption[0]); fsm.set_ShowStateLabel(GUILayout.Toggle(fsm.get_ShowStateLabel(), SkillEditorContent.ShowStateLabelsLabel, new GUILayoutOption[0])); fsm.EnableBreakpoints = GUILayout.Toggle(fsm.EnableBreakpoints, SkillEditorContent.EnableBreakpointsLabel, new GUILayoutOption[0]); fsm.EnableDebugFlow = GUILayout.Toggle(fsm.EnableDebugFlow, SkillEditorContent.EnableDebugFlowLabel, new GUILayoutOption[0]); SkillEditorGUILayout.LightDivider(new GUILayoutOption[0]); GUILayout.Label("Experimental", EditorStyles.get_boldLabel(), new GUILayoutOption[0]); EditorGUILayout.HelpBox(Strings.get_Help_Experimental_Warning(), 0); fsm.set_KeepDelayedEventsOnStateExit(GUILayout.Toggle(fsm.get_KeepDelayedEventsOnStateExit(), SkillEditorContent.KeepDelayedEvents, new GUILayoutOption[0])); fsm.set_ManualUpdate(GUILayout.Toggle(fsm.get_ManualUpdate(), SkillEditorContent.ManualUpdate, new GUILayoutOption[0])); GUILayout.EndScrollView(); EventType arg_641_0 = Event.get_current().get_type(); if (EditorGUI.EndChangeCheck()) { SkillEditor.SetFsmDirty(false, false); } if (Event.get_current().get_type() == null) { GUIUtility.set_keyboardControl(0); } SkillEditorGUILayout.LightDivider(new GUILayoutOption[0]); EditorGUI.BeginDisabledGroup(true); GUILayout.Label("Data Version: " + fsm.get_DataVersion(), EditorStyles.get_miniLabel(), new GUILayoutOption[0]); EditorGUI.EndDisabledGroup(); SkillEditorGUILayout.LockFsmGUI(fsm); }