Search Unity

Scriptable build pipeline custom build tasks

Discussion in 'Asset Bundles' started by nilsdr, Oct 4, 2019.

  1. nilsdr

    nilsdr

    Joined:
    Oct 24, 2017
    Posts:
    355
    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/c...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
     
    pahe4retro and dnnkeeper like this.
  2. dnnkeeper

    dnnkeeper

    Joined:
    Jul 7, 2013
    Posts:
    74
    +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.
     
    pahe4retro and nilsdr like this.
  3. nilsdr

    nilsdr

    Joined:
    Oct 24, 2017
    Posts:
    355
    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?
     
  4. Windwalk_Rosco

    Windwalk_Rosco

    Joined:
    Aug 10, 2020
    Posts:
    11
    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
     
    PatHightree likes this.
unityunity