Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Is it possible to create a group for debugging

Discussion in 'Addressables' started by Nkp46, Nov 8, 2022.

  1. Nkp46

    Nkp46

    Joined:
    Nov 10, 2016
    Posts:
    8
    I want to create a group of debugging files in Addressable.
    I don't want to include that group when building a release version.

    Does Addressable have such functionality?
    Is there no choice but to manually delete it after building?
     
    JesseSTG likes this.
  2. JesseSTG

    JesseSTG

    Joined:
    Jan 10, 2019
    Posts:
    236
    Yes, you can do so with a custom data builder. Your builder should either extend BuildScriptPackedMode or keep a reference to one that it defers to.

    You'll want to override the ProcessGroup method; if you want to process a given AddressableAssetGroup normally, call the base implementation. If you want to exclude an asset group, return string.Empty. If your group has some kind of error (perhaps something specific to your game), return a non-empty string with the details.
     
  3. Nkp46

    Nkp46

    Joined:
    Nov 10, 2016
    Posts:
    8
    Thanks!
    I was able to eliminate the debug group by overriding ProcessGroup of BuildScriptPackedMode.
     
    JesseSTG likes this.