예제 #1
0
        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;
        }
예제 #2
0
 private static void OpenEditorSettings()
 {
     BuildSettingsWindow.ShowWindow();
 }
예제 #3
0
 private void OnDestroy()
 {
     _windowInstance = null;
 }
예제 #4
0
 /// <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);
 }