private void OnGUI() { using (EditorOneBuild.EditorLocalizationValues.BeginScope()) { GUIBuildSettigns(); using (new GUILayout.HorizontalScope()) { if (GUILayout.Button("Open Project Settings".Localization())) { //EditorApplication.ExecuteMenuItem("Edit/Project Settings.../Player"); SettingsService.OpenProjectSettings("Project/Player"); // Selection.activeObject = Unsupported.GetSerializedAssetInterfaceSingleton("PlayerSettings"); } if (GUILayout.Button("Load Settings".Localization())) { EditorOneBuild.UpdateConfig(); } if (GUILayout.Button("Build".Localization())) { if (Event.current.shift) { var options = EditorOneBuild.CreateBuildOptions(); options.versionName = UserBuildSettings.AvalibleVersionName; options.isPreBuild = true; EditorOneBuild.Build(options); } else { EditorOneBuild.Build(UserBuildSettings.AvalibleVersionName); } } } using (new GUILayout.HorizontalScope()) { var style = new GUIStyle(EditorStyles.largeLabel); style.fontSize += 4; style.padding = new RectOffset(5, 0, 1, 0); style.margin = new RectOffset(); if (GUILayout.Button("↻", style, GUILayout.ExpandWidth(false))) { Refresh(); } int selectedIndex = configPaths.IndexOf(selectedPath); int newIndex = EditorGUILayout.Popup(selectedIndex, displayPaths); if (newIndex != selectedIndex) { Select(configPaths[newIndex]); } EditorGUILayoutx.PingButton(selectedPath); if (GUILayout.Button("New Config".Localization(), GUILayout.ExpandWidth(false))) { var wizard = ScriptableWizard.DisplayWizard <CreateBuildConfigWizard>("Create Build Config"); wizard.callback = (path) => { if (path != null) { path = path.ReplacePathSeparator(); GUIUtility.keyboardControl = -1; Refresh(); string newPath = null; for (int i = 0; i < configPaths.Count; i++) { if (configPaths[i].Equals(path, StringComparison.InvariantCultureIgnoreCase)) { newPath = configPaths[i]; break; } } Select(path); } }; } } if (doc == null) { return; } using (var sv = new GUILayout.ScrollViewScope(scrollPos)) { scrollPos = sv.scrollPosition; using (var checker = new EditorGUI.ChangeCheckScope()) { float oldWidth = EditorGUIUtility.labelWidth; EditorGUIUtility.labelWidth = Mathf.Max(EditorGUIUtility.labelWidth, Screen.width * 0.3f); foreach (XmlElement typeNode in doc.DocumentElement.SelectNodes("ns:Type", nsMgr)) { DrawTypeNode(typeNode); } EditorGUIUtility.labelWidth = oldWidth; if (checker.changed) { DirtyConfig(); } } using (new GUILayout.HorizontalScope()) { if (doc != null) { if (GUILayout.Button("Add Type...", "popup")) { GenericMenu menu = new GenericMenu(); configTypes.Where(item => { Type configType = item.Key; if (!ContainsType(configType.FullName)) { menu.AddItem(new GUIContent(configType.FullName), false, () => { AddType(configType, item.Value); }); } return(false); }).ToArray(); menu.ShowAsContext(); } } } } } }