Scriptable build pipeline custom build tasks

Hi,

Can we get some documentation on the usage of custom build tasks in the SBP? All I can find is the api reference, but no usage examples

https://docs.unity3d.com/Packages/com.unity.scriptablebuildpipeline@1.5/api/UnityEditor.Build.Pipeline.Tasks.html

Right now we do some custom pre processing of scenes that are about to be built to assetbundles. We have an editor script which opens the scene and changes/adds some components just before issuing the build command, and were wondering if this can be replaced by a build task (but can’t find examples of it)

@Ryanc_unity

2 Likes

+1
I’d like to replace some objects on scenes with dummies at build time so these objects will only be downloaded at runtime through addressables. But I can’t find a guide how to inject this step into the build pipeline.

2 Likes

So, a year later, still don’t really know the answer to this. It seems that i can implement the buildtask interface and then pass an instance of my class to the scriptable build pipeline. This however appears to make it the ONLY build task thats executed.

Can I call the contentpipelines build function and add tasks to it?

I suggest digging through the SBP source code and you’ll see there that the CompatabilityBuildPipeline.Build() uses the ContentPipeline.Build() which uses a set of default task lists. You could likely write your own version of these classes by just copying the code and replacing the default task list with your own

1 Like