Version: 2022.3

BuildOptions.DetailedBuildReport

切换到手册

描述

Generates more information in the BuildReport.

The BuildReport object returned by BuildPipeline.BuildPlayer will contain more details (about build times and contents), at the cost of a slightly (typically, a few percents) longer build time.

The following script example illustrates how to use DetailedBuildReport when building a player. Create a project and add the script under Assets/Editor.

using UnityEditor;
using UnityEngine;

public class DetailedBuildReportExample : MonoBehaviour { [MenuItem("Build/DetailedBuildReport example")] public static void MyBuild() { BuildPlayerOptions buildPlayerOptions = new BuildPlayerOptions(); buildPlayerOptions.scenes = new[] { "Assets/scene.unity" }; buildPlayerOptions.locationPathName = "DetailedReportBuild/MyGame.exe"; buildPlayerOptions.target = BuildTarget.StandaloneWindows64;

buildPlayerOptions.options = BuildOptions.DetailedBuildReport;

var buildReport = BuildPipeline.BuildPlayer(buildPlayerOptions); } }

Now run the "Build/DetailedBuildReport example" scripts example.
You can now get more information about the build process in the variable "buildReport", that you can process using the BuildReport API.
You can find illustrations of how to query the BuildReport API by looking at the Build Report Inspector source script .

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961