Search Unity

Question Exclude AddressableAssetGroups from Player Build

Discussion in 'Addressables' started by crdmrn, Dec 5, 2021.

  1. crdmrn

    crdmrn

    Joined:
    Dec 24, 2013
    Posts:
    152
    As we have a Demo of our game, which obviously only contains part of the full game's content, we're trying to exclude such content during the build process, without having to rebuild AssetGroups every time, which is very time consuming and also has the risk of increasing patch sizes.

    How do I do this? I couldn't find any thread nor useful example on the documentation :(

    Am I just supposed to delete them from the StreamingAssets folder after build?

    What about those platforms that don't provide a folder, but a single packed files after build, like consoles?
     
    Last edited: Dec 5, 2021
  2. JelteS

    JelteS

    Joined:
    Jan 30, 2018
    Posts:
    16
    I don't think it's possible without rebuilding. You can flag AssetGroups to be not included in build.

    The risk of either deleting them post build or flagging them as "Not included in build" is that if any bundles that you do need have a dependency to the deleted bundles your game will fail to load.

    It's best to do this in a PreBuildProcessor (with a callbackOrder higher than 1), so that it is done before the build process is creating the packed file.
     
  3. crdmrn

    crdmrn

    Joined:
    Dec 24, 2013
    Posts:
    152
    Hi JelteS, and thank you for answering ^^
    How do I do that?
    Cause the "dontincludeinbuild" bool in the AssetGroupSchema refers to the Bundle group build, not the player build...
    Also, we have a pretty good bundle structure so I know exactly which ones are safe to delete.
    I'm already using a Pre/PostProcessor but I'm not sure how to retrieve a reference to the bundle assets.
     
  4. crdmrn

    crdmrn

    Joined:
    Dec 24, 2013
    Posts:
    152
    EDIT: Seems like moving unneeded bundles to another temp folder does the trick.
    The problem now is that somehow they cant be moved Back to the original location because the bundles folder doesn't exist when OnPostprocessBuild gets called? :S