# SetIncludeInBuildDelegate(IncludeInBuildDelegate)

> Sets the delegate function to be called by ShouldIncludeInBuild.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.0/script-reference/unityeditor.md)
* **Assembly:** UnityEditor

```csharp
public void SetIncludeInBuildDelegate(PluginImporter.IncludeInBuildDelegate includeInBuildDelegate)
```

### Parameters

**** (\[IncludeInBuildDelegate]\(/engine/6000.0/script-reference/unityeditor/pluginimporter/includeinbuilddelegate)):&#x20;

### Remarks

The delegate is called by [PluginImporter.ShouldIncludeInBuild](/engine/6000.0/script-reference/unityeditor/pluginimporter/shouldincludeinbuild.md) and returns true if the plugin is to be included in the build, and false otherwise.

**Important**: The build pipeline supports `SetIncludeInBuildDelegate` both for builds triggered from the Editor UI and those made from code with the [BuildPipeline](/engine/6000.0/script-reference/unityeditor/buildpipeline.md) APIs. However, take extra care when building from scripts with [BuildPipeline](/engine/6000.0/script-reference/unityeditor/buildpipeline.md) to make sure your build code is running in the right context. Script-based builds can encounter problems if they're running for a different build target than the currently active one. When building from a script, Unity can't recompile and reload assemblies to match the script's target, so the build script continues to run for the active target. If `SetIncludeInBuildDelegate` appears not to work in your build scripts, double-check that the delegate is being set early enough and on the right PluginImporter instance. Also make sure that any platform-specific, conditionally-compiled code is being executed as expected in the current context. For more information, refer to [Create a custom build script](/engine/6000.0/manual/building-and-publishing/build-customize-build-pipeline/build-script-build.md).
