Version: Unity 6.5 Alpha (6000.5)
LanguageEnglish
  • C#

BuildPlayerOptions.subtarget

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 int subtarget;

Description

The Subtarget to build.

If you only set BuildPlayerOptions.target and not BuildPlayerOptions.subtarget, this defaults to the platform's default subtarget.

Setting this property persists the value in EditorUserBuildSettings, which overwrites the current Editor subtarget. This behavior also affects an active BuildProfile. When using a build profile, use BuildPlayerWithProfileOptions instead.

Both this property and BuildPlayerOptions.target should remain unset to automatically use the target and subtarget as defined in the current Build Profile.

The valid values for this property correspond to target-specific enum types, which are stored as integers. Examples of these enum types include StandaloneBuildSubtarget, MobileTextureSubtarget, WebGLTextureSubtarget and XboxBuildSubtarget.

Usage examples:

Additional resources: BuildAssetBundlesParameters.subtarget, EditorUserBuildSettings.standaloneBuildSubtarget, EditorUserBuildSettings.androidBuildSubtarget, EditorUserBuildSettings.webGLBuildSubtarget, EditorUserBuildSettings.ps4BuildSubtarget