Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

BuildPlayerOptions.target

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public BuildTarget target;

Description

The BuildTarget to build.

For best results, leave this property unset so that the build uses the target defined in the active BuildProfile. If you do set it, set it to match the active build target.

Building a target that doesn't match the active build target is unreliable. Changing the active build target requires recompiling Editor scripts for the new platform and a domain reload, which can't happen while a build script is running. As a result, build callbacks and platform-dependent code might compile for the wrong platform, and some platforms fail to build at all.

To select the target, set the active build profile first: use the Build Profiles window in the Editor, or the -activeBuildProfile or -buildTarget argument on the command line. For more information, refer to Create a custom build script.

Additional resources: EditorUserBuildSettings.activeBuildTarget

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