Search Unity

AssetBundle help

Discussion in 'Editor & General Support' started by Zinov, Jul 25, 2016.

  1. Zinov

    Zinov

    Joined:
    Jul 20, 2015
    Posts:
    38
    Hello.
    Recently we moved all of our images into AssetBundle, stored in SharedAssets and loaded localy. However, we want prefabs using those images to stay in static build. Now we end up with duplicated data. We cannot delete local images, since they are on prefabs. AssetBudle documentation is very vague and not clear about this use case, so I would like someone to confirm that thing we try to achieve is impossible. Thanks in advance.

    EDIT: to clarify. We cannot move our prefabs out to AssetBundles since they are very dependent on ThirdParty library which refuses to hook up on them on the fly.
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    Can you change the logic that is used to load the images at runtime in your prefabs?

    For example - instead of directly referencing Sprites through Sprite renderer components, you can create a new component that will load a texture at runtime from an asset bundle.

    Moreover, you can create a process that will dynamically break texture references from prefabs at build time and replace them with this custom component automatically.
     
    Zinov likes this.
  3. Zinov

    Zinov

    Joined:
    Jul 20, 2015
    Posts:
    38
    Yeah, thank you. Sounds like an idea. I'm going to check this out.