Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

how to do alternative bundle or bundle variant

Discussion in 'Addressables' started by astrokoala, Oct 9, 2019.

  1. astrokoala


    Mar 23, 2016
    I need to build my game with a variant asset

    for example, I need a green blood splatter asset for a build.

    is there anyway to do that with Addressables?

    I checked the samples, there is texture variant sample, but it only handles the same texture file but with different import setting
    which technically is still the same asset, but with different import setting
    I need to use different asset but same asset reference
  2. Favo-Yang


    Apr 4, 2011
    Various solutions depends on your demand.

    If reference asset using address (string), you can just mix address and label as a trivial solution to achieve variant (even on runtime switching).

    You can optional build and load custom catalog, if you think put all variants into one big catalog is not acceptable. But it requires more knowledge about the system.

    If reference asset using AssetReference* object, it can be tricky. AssetReference located asset using guid, in your case different texture files have different guids. I'm sure a hacky provider can swap the guid to correct variant underlying, but seems too complex. Other folks may have better solution I guess.
    unity_bill likes this.