private void DoSelectedActionPreview() { SkillEditorGUILayout.LabelWidth(150f); this.previewScrollViewHeight = Mathf.Min(base.get_position().get_height() - 150f - this.descriptionHeight, this.previewActionGUIHeight); this.previewScrollPosition = EditorGUILayout.BeginScrollView(this.previewScrollPosition, new GUILayoutOption[] { GUILayout.Height(this.previewScrollViewHeight) }); GUILayout.BeginVertical(new GUILayoutOption[0]); bool enabled = GUI.get_enabled(); GUI.set_enabled(false); SkillEditor.ActionEditor.OnGUI(this.previewAction); GUI.set_enabled(enabled); GUILayout.EndVertical(); if (Event.get_current().get_type() == 7) { float num = this.previewActionGUIHeight; this.previewActionGUIHeight = GUILayoutUtility.GetLastRect().get_height() + 5f; if (Math.Abs(this.previewActionGUIHeight - num) > 1f) { base.Repaint(); this.autoScroll = true; } } EditorGUILayout.EndScrollView(); SkillEditorGUILayout.Divider(new GUILayoutOption[0]); EditorGUILayout.Space(); }
private void DoVariableEditor() { SkillEditorGUILayout.LabelWidth(100f); SkillEditorGUILayout.Divider(new GUILayoutOption[0]); if (this.isVariableSelected) { EditorGUI.BeginDisabledGroup(this.editingGlobalVariables); this.editNameTextField.OnGUI(new GUILayoutOption[0]); EditorGUI.EndDisabledGroup(); EditorGUI.BeginChangeCheck(); this.selectedFsmVariable.DoEditorGUI(null, this.editingAsset); this.selectedFsmVariable.Tooltip = EditorGUILayout.TextField(SkillEditorContent.TooltipLabel, this.selectedFsmVariable.Tooltip, new GUILayoutOption[0]); this.categoryTextField.OnGUI(new GUILayoutOption[0]); if (!this.editingGlobalVariables) { this.selectedFsmVariable.ShowInInspector = EditorGUILayout.Toggle(SkillEditorContent.InspectorLabel, this.selectedFsmVariable.ShowInInspector, new GUILayoutOption[0]); } if (SkillVariable.CanNetworkSync(this.selectedFsmVariable.NamedVar)) { this.selectedFsmVariable.NetworkSync = EditorGUILayout.Toggle(SkillEditorContent.NetworkSyncLabel, this.selectedFsmVariable.NetworkSync, new GUILayoutOption[0]); if (FsmEditorSettings.CheckForNetworkSetupErrors && this.selectedFsmVariable.NetworkSync) { this.CheckForNetworkSyncErrors(); } } else { bool enabled = GUI.get_enabled(); GUI.set_enabled(false); EditorGUILayout.Toggle(SkillEditorContent.NetworkSyncNotSupportedLabel, false, new GUILayoutOption[0]); GUI.set_enabled(enabled); } if (EditorGUI.EndChangeCheck()) { this.UpdateVariable(this.selectedFsmVariable, ""); } if (!this.editNameTextField.IsValid) { GUILayout.Box(Strings.get_Error_Variable_Name_Taken(), SkillEditorStyles.ErrorBox, new GUILayoutOption[0]); } } else { this.addVariableTextField.OnGUI(new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); this.newVariableType = EditorGUILayout.Popup(SkillEditorContent.EditVariableTypeLabel, this.newVariableType, SkillVariable.VariableTypeNames, new GUILayoutOption[0]); EditorGUI.BeginDisabledGroup(!this.addVariableTextField.IsValid || this.addVariableTextField.Text.get_Length() == 0); if (GUILayout.Button(SkillEditorContent.AddLabel, new GUILayoutOption[] { GUILayout.MaxWidth(35f), GUILayout.MaxHeight(15f) })) { this.AddVariable(this.addVariableTextField); } EditorGUI.EndDisabledGroup(); GUILayout.EndHorizontal(); if (!this.addVariableTextField.IsValid) { GUILayout.Box(Strings.get_Error_Variable_Name_Taken(), SkillEditorStyles.ErrorBox, new GUILayoutOption[0]); } } if (FsmEditorSettings.ShowHints) { GUILayout.Box((!string.IsNullOrEmpty(this.editNameTextField.Text)) ? Strings.get_Hint_Inspector_Usage() : Strings.get_Hint_Variable_Usage(), SkillEditorStyles.HintBox, new GUILayoutOption[0]); } }
public void OnGUI(Rect area) { EditorGUI.set_indentLevel(0); GUILayout.BeginArea(area); if (EditorApplication.get_isPlaying() && FsmEditorSettings.DisableInspectorWhenPlaying) { GUILayout.BeginHorizontal(EditorStyles.get_toolbar(), new GUILayoutOption[0]); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.Label(Strings.get_Hint_Inspector_disabled_when_playing(), new GUILayoutOption[0]); FsmEditorSettings.DisableInspectorWhenPlaying = !GUILayout.Toggle(!FsmEditorSettings.DisableInspectorWhenPlaying, Strings.get_Hint_Enable_inspector_when_playing(), new GUILayoutOption[0]); if (GUI.get_changed()) { FsmEditorSettings.SaveSettings(); } GUILayout.EndArea(); return; } this.View = area; SkillEditorGUILayout.LabelWidth(150f); GUILayout.BeginVertical(new GUILayoutOption[0]); this.DoModeSelector(); if (this.inspectorMode != InspectorMode.FsmInspector && this.inspectorMode != InspectorMode.Preferences && !Application.get_isPlaying() && SkillEditor.SelectedFsmUsesTemplate) { GUILayout.Label(Strings.get_Label_FSM_Uses_Template(), new GUILayoutOption[0]); if (FsmEditorSettings.ShowHints) { GUILayout.Box(Strings.get_InspectorPanel_FSM_Uses_Template(), SkillEditorStyles.HintBox, new GUILayoutOption[0]); } GUILayout.FlexibleSpace(); } else { if (this.inspectorMode != InspectorMode.Preferences) { SkillEditorGUILayout.UnlockFsmGUI(SkillEditor.SelectedFsm); EditorGUI.BeginDisabledGroup(SkillEditor.SelectedFsm != null && SkillEditor.SelectedFsm.get_Locked()); } switch (this.inspectorMode) { case InspectorMode.FsmInspector: FsmInspector.OnGUI(); break; case InspectorMode.StateInspector: if (!SkillEditor.SelectedFsmIsLocked) { InspectorPanel.BeginPrefabInstanceCheck(); SkillEditor.StateInspector.OnGUI(); InspectorPanel.EndPrefabInstanceCheck(); } else { GUILayout.FlexibleSpace(); } break; case InspectorMode.EventManager: if (!SkillEditor.SelectedFsmIsLocked) { InspectorPanel.BeginPrefabInstanceCheck(); SkillEditor.EventManager.OnGUI(); InspectorPanel.EndPrefabInstanceCheck(); } else { GUILayout.FlexibleSpace(); } break; case InspectorMode.VariableManager: if (!SkillEditor.SelectedFsmIsLocked) { InspectorPanel.BeginPrefabInstanceCheck(); SkillEditor.VariableManager.OnGUI(); InspectorPanel.EndPrefabInstanceCheck(); } else { GUILayout.FlexibleSpace(); } break; case InspectorMode.Preferences: FsmEditorSettings.OnGUI(); break; case InspectorMode.Watermarks: WatermarkSelector.OnGUI(); break; } if (this.inspectorMode != InspectorMode.Preferences) { EditorGUI.EndDisabledGroup(); } } this.DoBottomToolbar(); GUILayout.EndVertical(); GUILayout.EndArea(); }
public override void DoGUI() { SkillEditorStyles.Init(); SkillEditorGUILayout.ToolWindowLargeTitle(this, Strings.get_CustomActionWizard_Full_Title()); SkillEditorGUILayout.LabelWidth(200f); this.HandleDragPreviewDivider(); this.controlsScrollPosition = EditorGUILayout.BeginScrollView(this.controlsScrollPosition, new GUILayoutOption[0]); EditorGUI.set_indentLevel(1); CustomActionWizard.ControlGroup(Strings.get_CustomActionWizard_Group_Name_and_Description()); this.actionName = SkillEditorGUILayout.TextFieldWithHint(this.actionName, Strings.get_CustomActionWizard_Label_Action_Name(), new GUILayoutOption[0]); this.tooltip = SkillEditorGUILayout.TextAreaWithHint(this.tooltip, Strings.get_CustomActionWizard_Label_Description(), new GUILayoutOption[] { GUILayout.Height(80f) }); CustomActionWizard.ControlGroup(Strings.get_CustomActionWizard_Group_Category()); GUI.set_enabled(string.IsNullOrEmpty(this.customCategory)); this.selectedCategory = EditorGUILayout.Popup(Strings.get_CustomActionWizard_Select_Category(), this.selectedCategory, this.actionCategories, new GUILayoutOption[0]); GUI.set_enabled(true); this.customCategory = EditorGUILayout.TextField(Strings.get_CustomActionWizard_Custom_Category(), this.customCategory, new GUILayoutOption[0]); CustomActionWizard.ControlGroup(Strings.get_CustomActionWizard_Generated_Code_Folder()); this.rootFolder = EditorGUILayout.TextField(Strings.get_CustomActionWizard_Root_Folder(), this.rootFolder, new GUILayoutOption[0]); GUI.set_enabled(!this.folderSameAsCategory); this.actionFolder = EditorGUILayout.TextField(Strings.get_CustomActionWizard_Action_Folder(), this.actionFolder, new GUILayoutOption[0]); GUI.set_enabled(true); this.folderSameAsCategory = EditorGUILayout.Toggle(Strings.get_CustomActionWizard_Same_as_Category(), this.folderSameAsCategory, new GUILayoutOption[0]); CustomActionWizard.ControlGroup(Strings.get_CustomActionWizard_Add_Methods()); this.handlesOnEnter = EditorGUILayout.Toggle("OnEnter", this.handlesOnEnter, new GUILayoutOption[0]); this.handlesOnUpdate = EditorGUILayout.Toggle("OnUpdate", this.handlesOnUpdate, new GUILayoutOption[0]); this.handlesOnFixedUpdate = EditorGUILayout.Toggle("OnFixedUpdate", this.handlesOnFixedUpdate, new GUILayoutOption[0]); this.handlesOnLateUpdate = EditorGUILayout.Toggle("OnLateUpdate", this.handlesOnLateUpdate, new GUILayoutOption[0]); this.handlesOnExit = EditorGUILayout.Toggle("OnExit", this.handlesOnExit, new GUILayoutOption[0]); this.hasCustomErrorChecker = EditorGUILayout.Toggle(Strings.get_CustomActionWizard_Custom_Error_Checker(), this.hasCustomErrorChecker, new GUILayoutOption[0]); EditorGUILayout.EndScrollView(); if (!this.isValid) { SkillEditorGUILayout.Divider(new GUILayoutOption[0]); EditorGUI.set_indentLevel(0); EditorGUILayout.HelpBox(this.errorString, 3, true); } GUILayout.BeginHorizontal(EditorStyles.get_toolbar(), new GUILayoutOption[0]); GUILayout.Label(Strings.get_CustomActionWizard_Code_Preview(), new GUILayoutOption[0]); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); if (Event.get_current().get_type() == 7) { this.previewDividerRect = GUILayoutUtility.GetLastRect(); } EditorGUIUtility.AddCursorRect(this.previewDividerRect, 2); this.previewScrollPosition = EditorGUILayout.BeginScrollView(this.previewScrollPosition, new GUILayoutOption[] { GUILayout.MinHeight(this.previewHeight) }); GUILayout.Label(this.code, new GUILayoutOption[0]); EditorGUILayout.EndScrollView(); SkillEditorGUILayout.Divider(new GUILayoutOption[0]); GUILayout.Label(Strings.get_CustomActionWizard_File_Path_Prefix() + this.localAssetFilename, new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUI.set_enabled(this.isValid); if (GUILayout.Button(Strings.get_CustomActionWizard_Save_Button(), new GUILayoutOption[0])) { this.SaveCustomAction(); GUIUtility.ExitGUI(); return; } GUI.set_enabled(true); if (GUILayout.Button(new GUIContent(Strings.get_CustomActionWizard_Find_File(), Strings.get_CustomActionWizard_Find_File_Tooltip()), new GUILayoutOption[] { GUILayout.MaxWidth(100f) })) { this.PingScriptFile(); } if (GUILayout.Button(new GUIContent(Strings.get_CustomActionWizard_Copy_Code(), Strings.get_CustomActionWizard_Copy_Code_Tooltip()), new GUILayoutOption[] { GUILayout.MaxWidth(100f) })) { this.CopyCodeToClipboard(); } GUILayout.EndHorizontal(); GUILayout.Space(10f); EditorGUI.set_indentLevel(0); if (GUI.get_changed()) { this.UpdateGUI(); GUIUtility.ExitGUI(); } }
public override void DoGUI() { SkillEditorStyles.Init(); SkillEditorGUILayout.ToolWindowLargeTitle(this, Strings.get_BugReportWindow_Title()); SkillEditorGUILayout.LabelWidth(200f); this.controlsScrollPosition = EditorGUILayout.BeginScrollView(this.controlsScrollPosition, new GUILayoutOption[0]); GUILayout.Label(Strings.get_BugReportWindow_Bug_Title_Label(), EditorStyles.get_boldLabel(), new GUILayoutOption[0]); this.description = EditorGUILayout.TextField(this.description, new GUILayoutOption[0]); GUILayout.Label(Strings.get_BugReportWindow_Bug_Description_Label(), EditorStyles.get_boldLabel(), new GUILayoutOption[0]); this.extra = EditorGUILayout.TextArea(this.extra, SkillEditorStyles.TextAreaWithWordWrap, new GUILayoutOption[] { GUILayout.ExpandHeight(true) }); this.area = (BugReportWindow.ScoutArea)EditorGUILayout.EnumPopup(Strings.get_BugReportWindow_Where_does_it_happen(), this.area, new GUILayoutOption[0]); this.frequencyIndex = EditorGUILayout.Popup(Strings.get_BugReportWindow_How_often_does_it_happen(), this.frequencyIndex, BugReportWindow.frequencyChoices, new GUILayoutOption[0]); this.email = EditorGUILayout.TextField(new GUIContent(Strings.get_BugReportWindow_Your_E_mail(), Strings.get_BugReportWindow_Your_E_mail_Tooltip()), this.email, new GUILayoutOption[0]); EditorGUILayout.EndScrollView(); SkillEditorGUILayout.Divider(new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.Label("PlayMaker: " + VersionInfo.AssemblyVersion, new GUILayoutOption[0]); GUILayout.Label("Unity: " + Application.get_unityVersion(), new GUILayoutOption[0]); GUILayout.Label("Build Target: " + EditorUserBuildSettings.get_activeBuildTarget(), new GUILayoutOption[0]); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); SkillEditorGUILayout.Divider(new GUILayoutOption[0]); GUILayout.BeginHorizontal(new GUILayoutOption[0]); if (GUILayout.Button(Strings.get_BugReportWindow_Submit_Button(), new GUILayoutOption[0])) { if (!this.isValid) { EditorUtility.DisplayDialog(Strings.get_BugReportWindow_Title(), this.errorString, Strings.get_OK()); } else { this.SubmitBugReportByMail(); } GUIUtility.ExitGUI(); return; } if (GUILayout.Button(new GUIContent(Strings.get_Command_Copy(), Strings.get_BugReportWindow_Copy_Tooltip()), new GUILayoutOption[] { GUILayout.MaxWidth(100f) })) { this.CopyReportToClipboard(); } if (GUILayout.Button(new GUIContent(Strings.get_Command_Reset()), new GUILayoutOption[] { GUILayout.MaxWidth(100f) })) { GUIUtility.set_keyboardControl(0); this.Reset(); } GUILayout.EndHorizontal(); GUILayout.Space(10f); if (GUI.get_changed()) { this.UpdateGUI(); GUIUtility.ExitGUI(); } }
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); }
private void DoEventEditor() { if (EditorWindow.get_focusedWindow() != SkillEditor.Window) { return; } SkillEditorGUILayout.LabelWidth(86f); bool flag = !SkillEvent.IsNullOrEmpty(this.selectedEvent); SkillEditorGUILayout.Divider(new GUILayoutOption[0]); if (flag && FsmEditorSettings.ShowHints) { GUILayout.Box(this.selectedEvent.get_IsSystemEvent() ? Strings.get_Hint_System_Events_cannot_be_renamed() : Strings.get_Hint_Use_Event_Browser_to_rename_globally(), SkillEditorStyles.HintBox, new GUILayoutOption[0]); } if (flag && this.selectedEvent.get_IsGlobal()) { SkillEditorGUILayout.ReadonlyTextField(SkillEditorContent.GlobalEventName, 82f, this.newEventName, new GUILayoutOption[0]); } else { if (!flag || !this.selectedEvent.get_IsSystemEvent()) { EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.Label(flag ? SkillEditorContent.EditEventNameLabel : SkillEditorContent.AddEventLabel, new GUILayoutOption[] { GUILayout.MaxWidth(80f) }); this.newEventName = EditorGUILayout.TextField(this.newEventName, new GUILayoutOption[0]); string text = SkillEditorGUILayout.FsmEventListPopup(); if (text != "") { this.AddEvent(text); return; } EditorGUILayout.EndHorizontal(); if (!flag && FsmEditorSettings.ShowHints) { GUILayout.Box(Strings.get_Tooltip_EventManager_Add_Event(), SkillEditorStyles.HintBox, new GUILayoutOption[0]); } } } if (flag) { bool flag2 = false; using (List <SkillEvent> .Enumerator enumerator = SkillEditor.SelectedFsm.ExposedEvents.GetEnumerator()) { while (enumerator.MoveNext()) { SkillEvent current = enumerator.get_Current(); if (current.get_Name() == this.selectedEvent.get_Name()) { flag2 = true; break; } } } bool flag3 = EditorGUILayout.Toggle(SkillEditorContent.EventInspectorLabel, flag2, new GUILayoutOption[0]); if (flag2 != flag3) { if (!flag3) { EditorCommands.RemoveExposedEvent(SkillEditor.SelectedFsm, this.selectedEvent); } else { EditorCommands.AddExposedEvent(SkillEditor.SelectedFsm, this.selectedEvent); } SkillEditor.SetFsmDirty(false, false); } if (FsmEditorSettings.ShowHints) { GUILayout.Box(Strings.get_Hint_EventManager_Expose_Events(), SkillEditorStyles.HintBox, new GUILayoutOption[0]); } } string text2 = this.ValidateEventName(flag); bool flag4 = string.IsNullOrEmpty(text2); if (!flag4) { GUILayout.Box(text2, SkillEditorStyles.ErrorBox, new GUILayoutOption[0]); } if (Event.get_current().get_isKey()) { if (flag4 && Keyboard.EnterKeyPressed()) { if (!flag) { this.AddEvent(this.newEventName); } else { this.RenameEvent(this.selectedEvent, this.newEventName); } Event.get_current().Use(); GUIUtility.ExitGUI(); return; } if (Event.get_current().get_keyCode() == 27) { this.Reset(); } } }