Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


BuildPlayerOptions

Provide various options to control the behavior of BuildPipeline.BuildPlayer.
Read time 1 minuteLast updated 5 days ago

Definition

  • Type: Struct
  • Namespace: UnityEditor
  • Assembly: UnityEditor
public struct BuildPlayerOptions

Remarks

Examples

using UnityEditor;using UnityEngine;public class BuildPlayerOptionsExample{ [MenuItem("Build/Log Build Settings")] public static void MyBuild() { // Log some of the current build options retrieved from the Build Settings Window BuildPlayerOptions buildPlayerOptions = BuildPlayerWindow.DefaultBuildMethods.GetBuildPlayerOptions(new BuildPlayerOptions()); Debug.Log("BuildPlayerOptions\n" + "Scenes: " + string.Join(",", buildPlayerOptions.scenes) + "\n" + "Build location: " + buildPlayerOptions.locationPathName + "\n" + "Options: " + buildPlayerOptions.options + "\n" + "Target: " + buildPlayerOptions.target); }}

Properties

Property

Description

assetBundleManifestPathThe path to an manifest file describing all of the asset bundles used in the build (optional).
extraScriptingDefinesThe additional preprocessor defines you can specify while compiling assemblies for the Player. These defines are appended to the existing Scripting Define Symbols list configured in the Player settings.
locationPathNameSpecifies the path for the application to be built.
optionsThe BuildOptions flags to apply when building the Player.
scenesThe Scenes to be included in the build.
subtargetThe Subtarget to build.
targetThe BuildTarget to build.
targetGroupThe BuildTargetGroup to build.