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

BuildDestinationSettings.buildPath

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 string buildPath;

Description

The destination path that Unity uses for the build.

Set this property to a fixed path or include variables in the path. Unity resolves each variable to the value of a public static field or property. Specify either an absolute path or a path relative to the project's root folder, which is the folder that contains the Assets folder. Enclose each variable in square brackets and use the fully qualified member name, for example [UnityEditor.EditorUserBuildSettings.activeBuildTarget].

When you read this property, Unity replaces each variable with the string value of the corresponding member and returns the fully resolved path. When you assign a value, Unity stores it unchanged. The stored value can contain unresolved variables.

Unity applies the following rules when it resolves a variable:

  • The variable must name a public static field or property that exists in a loaded assembly. Unity leaves any variable it can't resolve, including the surrounding brackets, unchanged in the path.
  • Unity converts the resolved value to a string and removes any characters that aren't valid in a file name, including directory separators.
  • Unity resolves variables recursively, so a resolved value can contain further variables. If any subsequent variable value refers back to an already resolved variable, Unity detects a cycle and logs a warning. In this case, Unity leaves the cyclic variable unresolved.