| Parameter | Description |
|---|---|
| buildTarget | The NamedBuildTarget. |
Gets the array of symbols for script compilation for the build target you select. Symbols are semicolon-separated. For example, "SYMBOL1;SYMBOL2".
using UnityEditor; using UnityEditor.Build; using UnityEngine;
public class GetScriptingDefineSymbolsExample { [MenuItem("Tools/Log Scripting Define Symbols")] static void LogScriptingDefineSymbols() { // Using built-in constants. string standaloneDefines = PlayerSettings.GetScriptingDefineSymbols(NamedBuildTarget.Standalone); UnityEngine.Debug.Log("Standalone: " + standaloneDefines);
// Migrating from BuildTargetGroup. NamedBuildTarget namedTarget = NamedBuildTarget.FromBuildTargetGroup(BuildTargetGroup.Android); string androidDefines = PlayerSettings.GetScriptingDefineSymbols(namedTarget); UnityEngine.Debug.Log("Android: " + androidDefines); } }
Gets the array of user-specified symbols for script compilation for the build target you select.