| Parameter | Description |
|---|---|
| buildParameters | The build settings to use for the build, such as paths, roots, options, and compression. |
BuildReport The BuildReport that contains the results and details of the build.
Builds a content directory (serialized assets and scenes plus a manifest) at a defined output path.
Register the folder at runtime with ContentLoadManager.RegisterContentDirectory.
Each entry in BuildContentDirectoryParameters.rootAssetPaths must be a ScriptableObject; the build includes those roots and
everything they reference (including LoadableObjectId, Loadable<T0>, and LoadableSceneId).
Creates an outputPath if missing, normalizes path separators, and defaults BuildContentDirectoryParameters.name to the output folder name.
The build uses EditorUserBuildSettings.activeBuildTarget and the active subtarget configured for that target in the build settings.
Select the intended platform in the Build Profile window or through command line arguments so that the active target is set to the desired setting prior to calling this method.
Additional resources: BuildContentDirectoryParameters, ContentLoadManager
using UnityEditor; using UnityEngine;
namespace BuildDocExamples { public class BuildPipeline_BuildContentDirectoryExample { [MenuItem("BuildDocExamples/Build/Build Content Directory")] public static void BuildContentDirectoryExample() { var parameters = new BuildContentDirectoryParameters { outputPath = "Builds/MyContentDirectory", rootAssetPaths = new[] { "Assets/MyRootAsset.asset" }, options = BuildContentOptions.None };
BuildPipeline.BuildContentDirectory(parameters); } } }