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(); } }