private void ConfigureBuildPlatforms(BuildEnvironmentConfig environmentConfiguration)
        {
            using (IndentLevelScope(1))
            {
                var buildPlatformsString = EnumFlagToString(environmentConfiguration.BuildPlatforms,
                                                            BuildPlatformToString);

                EditorGUI.BeginChangeCheck();

                var showBuildPlatforms = EditorGUILayout.Foldout(environmentConfiguration.ShowBuildPlatforms,
                                                                 "Build Platforms: " + buildPlatformsString);

                SpatialBuildPlatforms newBuildPlatforms = environmentConfiguration.BuildPlatforms;

                if (showBuildPlatforms)
                {
                    newBuildPlatforms = EnumFlagsToggleField(environmentConfiguration.BuildPlatforms,
                                                             BuildPlatformToString);
                }

                var currentAdjustedPlatforms = newBuildPlatforms;

                if ((currentAdjustedPlatforms & SpatialBuildPlatforms.Current) != 0)
                {
                    currentAdjustedPlatforms &= ~SpatialBuildPlatforms.Current;
                    currentAdjustedPlatforms |= WorkerBuilder.GetCurrentBuildPlatform();
                }

                if ((currentAdjustedPlatforms & SpatialBuildPlatforms.Windows32) != 0 &&
                    (currentAdjustedPlatforms & SpatialBuildPlatforms.Windows64) != 0)
                {
                    EditorGUILayout.HelpBox(
                        "\n" + WorkerBuilder.IncompatibleWindowsPlatformsErrorMessage + "\n",
                        MessageType.Error);
                }

                if (EditorGUI.EndChangeCheck())
                {
                    // build platforms have changed
                    EditorUtility.SetDirty(target);
                    Undo.RecordObject(target, "Configure build platforms for worker");

                    environmentConfiguration.ShowBuildPlatforms = showBuildPlatforms;
                    environmentConfiguration.BuildPlatforms     = newBuildPlatforms;
                }
            }
        }
        private void ConfigureBuildOptions(BuildEnvironmentConfig environmentConfiguration)
        {
            using (IndentLevelScope(1))
            {
                var buildOptionsString = EnumFlagToString(environmentConfiguration.BuildOptions);

                EditorGUI.BeginChangeCheck();

                var showBuildOptions = EditorGUILayout.Foldout(environmentConfiguration.ShowBuildOptions,
                                                               "Build Options: " + buildOptionsString);

                BuildOptions newBuildOptions = environmentConfiguration.BuildOptions;

                if (showBuildOptions)
                {
                    newBuildOptions = EnumFlagsToggleField(environmentConfiguration.BuildOptions);
                }

                if ((newBuildOptions & BuildOptions.EnableHeadlessMode) != 0 &&
                    (newBuildOptions & BuildOptions.Development) != 0)
                {
                    EditorGUILayout.HelpBox(
                        "\nYou cannot have both EnableHeadlessMode and Development in BuildOptions.\n\n" +
                        "This will crash Unity Editor while building.\n",
                        MessageType.Error);
                }

                if (EditorGUI.EndChangeCheck())
                {
                    // build options have changed

                    EditorUtility.SetDirty(target);
                    Undo.RecordObject(target, "Configure build options for worker");

                    environmentConfiguration.ShowBuildOptions = showBuildOptions;
                    environmentConfiguration.BuildOptions     = newBuildOptions;
                }
            }
        }