Search Unity

Asset bundles in build

Discussion in 'Asset Bundles' started by tawdry, Jun 24, 2018.

  1. tawdry

    tawdry

    Joined:
    Sep 3, 2014
    Posts:
    1,357
    Hi
    Just wondering textures mats mesh included in the asset bundles are they also included in the main build as well. As in do i have to physically remove them from the project before creating the build otherwise they would be included both in the assetbundle and the completed build?
     
  2. AlienMe

    AlienMe

    Joined:
    Sep 16, 2014
    Posts:
    93
    Hi there, Only assets referenced by the scenes included in your build are added to your build.

    So, if you have:
    - Scene A, included in Build, references Mesh1
    - Asset Bundle with Mesh1 and Mesh2.

    Then..

    Build will include: Scene A, Mesh1
    Asset Bundle will include: Mesh1, Mesh2

    Notice that Mesh1 is included twice, and Mesh2 is only included in the Asset Bundle.
     
  3. tawdry

    tawdry

    Joined:
    Sep 3, 2014
    Posts:
    1,357
    Hey Alien
    So in your example if i deleted Mesh1 after building the asset bundle will the asset bundle still load it correctly or does the mesh have to exist both in the build and the asset bundle for it to work?
     
  4. AlienMe

    AlienMe

    Joined:
    Sep 16, 2014
    Posts:
    93
    Well, what you really want to do is have an scenes included in your build, not use any assets you put into a bundle.

    So, in the example above, what would be ideal is:

    Build includes: Scene A
    Asset Bundle includes: Mesh1, and Mesh2.

    Where Scene A doesn't reference any assets from any bundle directly.