Search Unity

Dealing with duplicate assets in build and bundles

Discussion in 'Asset Bundles' started by Oana, Jun 26, 2019.

  1. Oana

    Oana

    Joined:
    Sep 28, 2012
    Posts:
    87
    Imagine you have a few menus you want to load as part of Asset Bundles, and a few you want in the build.

    These have a few assets in common, e.g. fonts, button sprites, etc.

    With standard practice, you end up with these assets both in the build, and in the bundles. They're also duplicated in memory at runtime.

    So how would you handle this? Is there a way to tell the bundle "this asset will be found in the build, don't include it with the bundle" or something? The most optimal way I can think of is to make all menus part of bundles, and load a "shared assets" bundle at the start, maybe from StreamingAssets instead of remotely.

    Are there any better practices? :)