public static void EnumTypeSelector(SkillEnum fsmEnum) { GUILayout.BeginHorizontal(new GUILayoutOption[0]); EditorGUILayout.PrefixLabel(Strings.get_Label_Enum_Type()); if (GUILayout.Button(SkillEditorContent.TempContent(Labels.GetShortTypeName(fsmEnum.get_EnumType()), fsmEnum.get_EnumName()), EditorStyles.get_popup(), new GUILayoutOption[0])) { VariableEditor.DoFsmEnumTypeMenu(fsmEnum); } GUILayout.EndHorizontal(); }
public static void Init(bool usingProSkin) { SkillEditorContent.FavoritesLabel = new GUIContent(Strings.get_Label_Favorites(), Strings.get_Tooltip_Favorites()); SkillEditorContent.ManualUpdate = new GUIContent(Strings.get_Label_Manual_Update(), Strings.get_Tooltip_ManualUpdate()); SkillEditorContent.KeepDelayedEvents = new GUIContent(Strings.get_Label_KeepDelayedEvents(), Strings.get_Tooltip_KeepDelayedEvents()); SkillEditorContent.LockFsmButton = new GUIContent(Strings.get_Label_Lock(), Strings.get_Tooltip_Lock_and_password_protect_FSM()); SkillEditorContent.ConfirmEditPrefabInstance = new GUIContent(Strings.get_Label_Confirm_Editing_Prefab_Instances(), Strings.get_Tooltip_Disable_editing_of_prefab_intances()); SkillEditorContent.EditFsmButton = new GUIContent(Strings.get_Label_Edit(), Strings.get_Tooltip_Edit_in_the_PlayMaker_Editor()); SkillEditorContent.RefreshTemplateLabel = new GUIContent(Strings.get_Label_Refresh_Template(), Strings.get_Tooltip_Refresh_Template()); SkillEditorContent.UseTemplateLabel = new GUIContent(Strings.get_Label_Use_Template(), Strings.get_Tooltip_Use_Template()); SkillEditorContent.BrowseTemplateButton = new GUIContent(Strings.get_Label_Browse(), Strings.get_Tooltip_Browse_Templates()); SkillEditorContent.MaxLoopOverrideLabel = new GUIContent(Strings.get_Label_Max_Loop_Override(), Strings.get_Tooltip_Max_Loop_Override()); SkillEditorContent.ShowStateLabelsLabel = new GUIContent(Strings.get_FsmEditorSettings_Show_State_Labels_in_Game_View(), Strings.get_Tooltip_Show_State_Label()); SkillEditorContent.EnableBreakpointsLabel = new GUIContent(Strings.get_Label_Enable_Breakpoints(), Strings.get_Tooltip_Enable_Breakpoints()); SkillEditorContent.EnableDebugFlowLabel = new GUIContent(Strings.get_FsmEditorSettings_Enable_DebugFlow(), Strings.get_FsmEditorSettings_Enable_DebugFlow_Tooltip()); SkillEditorContent.ResetOnDisableLabel = new GUIContent(Strings.get_Label_Reset_On_Disable(), Strings.get_Tooltip_Reset_On_Disable()); SkillEditorContent.FsmControlsLabel = new GUIContent(Strings.get_Label_Controls(), Strings.get_Tooltip_Controls()); SkillEditorContent.NetworkSyncLabel = new GUIContent(Strings.get_Label_Network_Sync(), Strings.get_Tooltip_Variables_Set_To_Network_Sync()); SkillEditorContent.MenuGraphViewCopyStates = new GUIContent(Strings.get_Menu_GraphView_Copy_States() + " %c"); SkillEditorContent.MenuGraphViewPasteStates = new GUIContent(Strings.get_Menu_GraphView_Paste_States() + " %v"); SkillEditorContent.MenuSelectAllActions = new GUIContent(Strings.get_Menu_Select_All_Actions() + " %a"); SkillEditorContent.MenuPasteActions = new GUIContent(Strings.get_Menu_Paste_Actions() + " %v"); SkillEditorContent.MenuCopySelectedActions = new GUIContent(Strings.get_Menu_Copy_Selected_Actions() + " %c"); SkillEditorContent.EditCategoryLabel = new GUIContent(Strings.get_Category(), Strings.get_Category_Tooltip()); SkillEditorContent.GlobalVariableName = new GUIContent(Strings.get_Variable(), Strings.get_Variable_Tooltip_Warning()); SkillEditorContent.GlobalEventName = new GUIContent(Strings.get_Event(), Strings.get_Event_Tooltip_Warning()); SkillEditorContent.StateBrowserButton = new GUIContent(Files.LoadTextureFromDll("browserIcon", 14, 14), Strings.get_Command_State_Browser()); SkillEditorContent.HelpButton = new GUIContent(Files.LoadTextureFromDll("helpIcon", 14, 14), Strings.get_Tooltip_Doc_Button()); SkillEditorContent.Play = new GUIContent(Files.LoadTextureFromDll("playButton", 17, 17)); SkillEditorContent.Pause = new GUIContent(Files.LoadTextureFromDll("pauseButton", 17, 17)); SkillEditorContent.Step = new GUIContent(Files.LoadTextureFromDll("stepButton", 17, 17)); SkillEditorContent.NewVariableLabel = new GUIContent(Strings.get_Label_New_Variable(), Strings.get_Tooltip_New_Variable()); SkillEditorContent.EditVariableLabel = new GUIContent(Strings.get_Label_Name()); SkillEditorContent.GlobalVariablesLabel = new GUIContent(Strings.get_Label_Global_Variables(), Strings.get_Tooltip_Global_Variables()); SkillEditorContent.VariableNameLabel = new GUIContent(Strings.get_Label_Name(), Strings.get_Tooltip_Variable_Name()); SkillEditorContent.VariableTypeLabel = new GUIContent(Strings.get_Label_Type(), Strings.get_Tooltip_Variable_Type()); SkillEditorContent.VariableValueLabel = new GUIContent(Strings.get_Label_Value()); SkillEditorContent.GlobalsLabel = new GUIContent(Strings.get_Label_Globals(), Strings.get_Tooltip_Globals()); SkillEditorContent.VariableUseCountLabel = new GUIContent(Strings.get_Label_Used(), Strings.get_Tooltip_Variable_Used_Count()); SkillEditorContent.TooltipLabel = new GUIContent(Strings.get_Label_Tooltip(), Strings.get_Tooltip_Tooltip()); SkillEditorContent.InspectorLabel = new GUIContent(Strings.get_Label_Inspector(), Strings.get_Tooltip_Inspector()); SkillEditorContent.NetworkSyncLabel = new GUIContent(Strings.get_Label_Network_Sync(), Strings.get_Tooltip_Network_Sync()); SkillEditorContent.NetworkSyncNotSupportedLabel = new GUIContent(Strings.get_Label_Network_Sync(), Strings.get_Tooltip_Network_Sync_Not_Supported()); SkillEditorContent.EditVariableTypeLabel = new GUIContent(Strings.get_Label_Variable_Type(), Strings.get_Tooltip_Edit_Variable_Type()); SkillEditorContent.AddLabel = new GUIContent(Strings.get_Label_Add()); SkillEditorContent.GlobalVariablesNameLabel = new GUIContent(Strings.get_Label_Name(), Strings.get_Tooltip_Global_Variables_Header()); SkillEditorContent.GlobalVariablesTypeLabel = new GUIContent(Strings.get_Label_Type(), Strings.get_Tooltip_Global_Variables_Type()); SkillEditorContent.AddGlobalVariableLabel = new GUIContent(Strings.get_Label_New_Variable(), Strings.get_Tooltip_Add_Global_Variable()); SkillEditorContent.GlobalVariableUseCountLabel = new GUIContent(Strings.get_Label_Used(), Strings.get_Tooltip_Global_Variables_Used_Count()); SkillEditorContent.EditEventNameLabel = new GUIContent(Strings.get_Label_Event_Name(), Strings.get_Tooltip_EventManager_Edit_Event()); SkillEditorContent.AddEventLabel = new GUIContent(Strings.get_Label_Add_Event(), Strings.get_Tooltip_EventManager_Add_Event()); SkillEditorContent.EventInspectorLabel = new GUIContent(Strings.get_Label_Inspector(), Strings.get_Tooltip_EventManager_Inspector_Checkbox()); SkillEditorContent.EventBrowserButtonLabel = new GUIContent(Strings.get_Command_Event_Browser(), Strings.get_Tooltip_Event_Browser_Button_in_Events_Tab()); SkillEditorContent.EventBroadcastIcon = new GUIContent(SkillEditorStyles.BroadcastIcon, Strings.get_Tooltip_Global_Event_Flag()); SkillEditorContent.EventHeaderLabel = new GUIContent(Strings.get_Label_Event(), Strings.get_Tooltip_Event_GUI()); SkillEditorContent.EventUsedHeaderLabel = new GUIContent(Strings.get_Label_Used(), Strings.get_Tooltip_Events_Used_By_States()); SkillEditorContent.GlobalEventTooltipLabel = new GUIContent("", Strings.get_Label_Global()); if (usingProSkin) { SkillEditorContent.FsmBrowserButton = new GUIContent(Files.LoadTextureFromDll("browserIcon", 14, 14), Strings.get_Tooltip_Editor_Windows()); SkillEditorContent.BackButton = new GUIContent(Files.LoadTextureFromDll("backIcon", 10, 14), "Select Previous FSM"); SkillEditorContent.ForwardButton = new GUIContent(Files.LoadTextureFromDll("forwardIcon", 10, 14), "Select Next FSM"); SkillEditorContent.RecentButton = new GUIContent(Files.LoadTextureFromDll("recentIcon", 10, 14), Strings.get_MainToolbar_Recent()); SkillEditorContent.DeleteButton = new GUIContent(Files.LoadTextureFromDll("deleteIcon", 17, 14), Strings.get_Command_Delete()); SkillEditorContent.ResetButton = new GUIContent(Files.LoadTextureFromDll("deleteIcon", 17, 14), Strings.get_Command_Reset()); SkillEditorContent.UpButton = new GUIContent(Files.LoadTextureFromDll("upIcon", 17, 14), Strings.get_Command_Move_Up()); SkillEditorContent.DownButton = new GUIContent(Files.LoadTextureFromDll("downIcon", 17, 14), Strings.get_Command_Move_Down()); SkillEditorContent.VariableButton = new GUIContent(Files.LoadTextureFromDll("variableIcon", 17, 14), Strings.get_Option_Use_Variable()); SkillEditorContent.SettingsButton = new GUIContent(Files.LoadTextureFromDll("settingsIcon", 14, 12), Strings.get_Command_Settings()); SkillEditorContent.BrowseButton = new GUIContent(Files.LoadTextureFromDll("browseIcon", 17, 14), Strings.get_Command_Browse()); SkillEditorContent.MainToolbarShowMinimap = new GUIContent(Files.LoadTextureFromDll("minimapIcon", 14, 14), Strings.get_Tooltip_Toggle_Minimap()); SkillEditorContent.PopupButton = new GUIContent(Files.LoadTextureFromDll("browseIcon", 17, 14), ""); } else { SkillEditorContent.FsmBrowserButton = new GUIContent(Files.LoadTextureFromDll("browserIcon_indie", 14, 14), Strings.get_Tooltip_Editor_Windows()); SkillEditorContent.BackButton = new GUIContent(Files.LoadTextureFromDll("backIcon_indie", 10, 14)); SkillEditorContent.ForwardButton = new GUIContent(Files.LoadTextureFromDll("forwardIcon_indie", 10, 14)); SkillEditorContent.RecentButton = new GUIContent(Files.LoadTextureFromDll("recentIcon_indie", 10, 14), Strings.get_MainToolbar_Recent()); SkillEditorContent.DeleteButton = new GUIContent(Files.LoadTextureFromDll("deleteIcon_indie", 17, 14), Strings.get_Command_Delete()); SkillEditorContent.ResetButton = new GUIContent(Files.LoadTextureFromDll("deleteIcon_indie", 17, 14), Strings.get_Command_Reset()); SkillEditorContent.UpButton = new GUIContent(Files.LoadTextureFromDll("upIcon_indie", 17, 14), Strings.get_Command_Move_Up()); SkillEditorContent.DownButton = new GUIContent(Files.LoadTextureFromDll("downIcon_indie", 17, 14), Strings.get_Command_Move_Down()); SkillEditorContent.VariableButton = new GUIContent(Files.LoadTextureFromDll("variableIcon_indie", 17, 14), Strings.get_Option_Use_Variable()); SkillEditorContent.SettingsButton = new GUIContent(Files.LoadTextureFromDll("settingsIcon_indie", 14, 12), Strings.get_Command_Settings()); SkillEditorContent.BrowseButton = new GUIContent(Files.LoadTextureFromDll("browseIcon_indie", 17, 14), Strings.get_Command_Browse()); SkillEditorContent.MainToolbarShowMinimap = new GUIContent(Files.LoadTextureFromDll("minimapIcon_indie", 14, 14), Strings.get_Tooltip_Toggle_Minimap()); SkillEditorContent.PopupButton = new GUIContent(Files.LoadTextureFromDll("browseIcon_indie", 17, 14), ""); } SkillEditorContent.DebugToolbarErrorCount = new GUIContent("", Strings.get_DebugToolbar_Error_Count_Tooltip()); SkillEditorContent.DebugToolbarDebug = new GUIContent(Strings.get_DebugToolbar_Label_Debug(), Strings.get_DebugToolbar_Label_Debug_Tooltip()); SkillEditorContent.DebugToolbarPrev = new GUIContent(Strings.get_DebugToolbar_Button_Prev(), Strings.get_DebugToolbar_Button_Prev_Toolrip()); SkillEditorContent.DebugToolbarNext = new GUIContent(Strings.get_DebugToolbar_Button_Next(), Strings.get_DebugToolbar_Button_Next_Tooltip()); SkillEditorContent.StateTitleBox = new GUIContent(); SkillEditorContent.StateDescription = new GUIContent(); SkillEditorContent.FsmDescription = new GUIContent(); SkillEditorContent.EventLabel = new GUIContent(); SkillEditorContent.MainToolbarSelectedGO = new GUIContent(); SkillEditorContent.MainToolbarSelectedFSM = new GUIContent(); SkillEditorContent.MainToolbarLock = new GUIContent(Strings.get_Command_Lock_Selected_FSM(), Strings.get_Tooltip_Lock_Selected_FSM()); SkillEditorContent.MainToolbarPrefabTypeNone = new GUIContent(Strings.get_Label_Select(), Strings.get_Command_Select_GameObject()); SkillEditorContent.HintGettingStarted = new GUIContent(Strings.get_Hint_GraphView_Getting_Started()); SkillEditorContent.HintGraphShortcuts = new GUIContent((Application.get_platform() == null) ? Strings.get_Hint_GraphView_Shortcuts_OSX() : Strings.get_Hint_GraphView_Shortcuts()); SkillEditorContent.HintGraphCommands = new GUIContent(Strings.get_Hint_GraphView_Shortcut_Description()); SkillEditorContent.HintGettingStartedSize = SkillEditorContent.CalcLineWrappedContentSize(SkillEditorContent.HintGettingStarted, SkillEditorStyles.HintBox); SkillEditorContent.HintGraphShortcutsSize = SkillEditorContent.CalcLineWrappedContentSize(SkillEditorContent.HintGraphShortcuts, SkillEditorStyles.HintBox); SkillEditorContent.HintGraphCommandsSize = SkillEditorContent.CalcLineWrappedContentSize(SkillEditorContent.HintGraphCommands, SkillEditorStyles.HintBox); }
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); }
public static SkillString FsmStringField(GUIContent label, Skill fsm, SkillString fsmString, object[] attributes) { if (fsmString.get_UseVariable()) { EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]); fsmString = VariableEditor.DoFsmStringPopup(label, fsm, fsmString); } else { if (fsmString.get_Value() == null) { fsmString.set_Value(string.Empty); } EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]); UIHint uIHint = CustomAttributeHelpers.GetUIHint(attributes); switch (uIHint) { case 1: { GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.Label(label, new GUILayoutOption[0]); Rect rect = GUILayoutUtility.GetRect(SkillEditorContent.TempContent(fsmString.get_Value(), ""), SkillEditorStyles.TextArea, new GUILayoutOption[] { GUILayout.MinHeight(44f) }); rect.set_width(340f); fsmString.set_Value(EditorGUI.TextArea(rect, fsmString.get_Value())); GUILayout.EndVertical(); goto IL_363; } case 2: fsmString.set_Value(ActionEditor.EditComponentName(label, fsmString.get_Value(), typeof(Behaviour))); goto IL_363; case 3: fsmString.set_Value(ActionEditor.EditComponentName(label, fsmString.get_Value(), typeof(MonoBehaviour))); ActionEditor.TrySetBehaviourContext(fsmString.get_Value()); goto IL_363; case 4: fsmString.set_Value(ActionEditor.EditMethodName(label, fsmString.get_Value(), false)); goto IL_363; case 6: fsmString.set_Value(EditorGUILayout.TextField(label, fsmString.get_Value(), new GUILayoutOption[0])); ActionEditor.AnimationNamePopup(fsmString); goto IL_363; case 7: fsmString.set_Value(EditorGUILayout.TagField(label, fsmString.get_Value(), new GUILayoutOption[0])); goto IL_363; case 8: StringEditor.LayerNamePopup(label, fsmString, null, null); goto IL_363; case 11: { fsmString.set_Value(EditorGUILayout.TextField(label, fsmString.get_Value(), new GUILayoutOption[0])); EditorGUI.BeginChangeCheck(); string text = SkillEditorGUILayout.ScriptListPopup(); if (EditorGUI.EndChangeCheck() && text != "") { fsmString.set_Value(text); goto IL_363; } goto IL_363; } case 15: fsmString.set_Value(EditorGUILayout.TextField(label, fsmString.get_Value(), new GUILayoutOption[0])); ActionEditor.FsmNamePopup(fsmString); goto IL_363; case 16: fsmString.set_Value(ActionEditor.EditFsmEvent(label, fsmString.get_Value())); goto IL_363; case 17: case 18: case 19: case 20: case 21: case 22: case 23: case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 31: fsmString.set_Value(EditorGUILayout.TextField(label, fsmString.get_Value(), new GUILayoutOption[0])); ActionEditor.VariablePopup(fsmString, uIHint); goto IL_363; case 32: fsmString.set_Value(EditorGUILayout.TextField(label, fsmString.get_Value(), new GUILayoutOption[0])); ActionEditor.AnimatorFloatPopup(fsmString); goto IL_363; case 33: fsmString.set_Value(EditorGUILayout.TextField(label, fsmString.get_Value(), new GUILayoutOption[0])); ActionEditor.AnimatorBoolPopup(fsmString); goto IL_363; case 34: fsmString.set_Value(EditorGUILayout.TextField(label, fsmString.get_Value(), new GUILayoutOption[0])); ActionEditor.AnimatorIntPopup(fsmString); goto IL_363; case 35: fsmString.set_Value(EditorGUILayout.TextField(label, fsmString.get_Value(), new GUILayoutOption[0])); ActionEditor.AnimatorTriggerPopup(fsmString); goto IL_363; case 36: StringEditor.SortingLayerNamePopup(label, fsmString, null, null); goto IL_363; } fsmString.set_Value(EditorGUILayout.TextField(label, fsmString.get_Value(), new GUILayoutOption[0])); } IL_363: fsmString = (SkillString)VariableEditor.VariableToggle(fsmString, label.get_text()); VariableEditor.EndVariableEditor(fsmString); return(fsmString); }
public static void PrefixLabel(string text) { SkillEditorGUILayout.PrefixLabel(SkillEditorContent.TempContent(text, "")); }