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

    astrokoala

    Joined:
    Mar 23, 2016
    Posts:
    19
    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

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    298
    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.