private void OnGUI() { // Edge case that takes place when the plugin code gets re-compiled while this window is open. if (_windowInstance == null) { _windowInstance = this; } var descriptionTextStyle = new GUIStyle(GUI.skin.label) { fontStyle = FontStyle.Italic, wordWrap = true }; EditorGUILayout.LabelField("Scenes in Build", EditorStyles.boldLabel); EditorGUILayout.LabelField( string.Format( "Note: the following settings affect APKs and app bundles built using the \"{0}\" menu's " + "build actions, but not apps built using the \"File\" menu's build actions.", GoogleEditorMenu.MainMenuName), descriptionTextStyle); EditorGUILayout.Space(); EditorGUILayout.LabelField( "The scenes in the build are selected via Unity's \"Build Settings\" window.", descriptionTextStyle); EditorGUILayout.Space(); EditorGUILayout.BeginHorizontal(); var enabledScenes = string.Join(", ", AndroidBuildHelper.GetEditorBuildEnabledScenes()); EditorGUILayout.LabelField(string.Format("Scenes: {0}", enabledScenes), EditorStyles.wordWrappedLabel); if (GUILayout.Button("Update", GUILayout.Width(100))) { GetWindow(Type.GetType("UnityEditor.BuildPlayerWindow,UnityEditor"), true); } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); EditorGUILayout.LabelField( "If you use AssetBundles, provide the path to your AssetBundle Manifest file below to ensure that " + "required engine components are not stripped during the build process.", descriptionTextStyle); EditorGUILayout.Space(); _assetBundleManifestPath = GetLabelAndTextField("AssetBundle Manifest (Optional)", _assetBundleManifestPath); EditorGUILayout.Space(); // Disable the Save button unless one of the fields has changed. GUI.enabled = IsAnyFieldChanged(); if (GUILayout.Button("Save")) { SaveConfiguration(); } GUI.enabled = true; }
private static void OpenEditorSettings() { BuildSettingsWindow.ShowWindow(); }
private void OnDestroy() { _windowInstance = null; }
/// <summary> /// Displays this window, creating it if necessary. /// </summary> public static void ShowWindow() { _windowInstance = (BuildSettingsWindow)GetWindow(typeof(BuildSettingsWindow), true, WindowTitle); _windowInstance.minSize = new Vector2(WindowMinWidth, WindowMinHeight); }