Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Bug?] Sprite for material is duplicated in the material's asset bundle

Discussion in 'Asset Bundles' started by MacroPinch, Jul 28, 2019.

  1. MacroPinch

    MacroPinch

    Joined:
    Dec 6, 2013
    Posts:
    43
    Hi,
    I believe we've found a bug in the asset bundles build-time asset dependency resolution. Filed a bug report case 1172663. Here are the details:

    Sprite for material is duplicated in the material's asset bundle although it's assigned to its own asset bundle

    1. What happened

    We have the following structure:
    * A sprite, which is linked to a material
    * The sprite is assigned to the "sprites" asset bundle and the material is assigned to the "materials" asset bundle

    When the asset bundles get built you can examine the "Editor.log" and see that:
    * The "sprites" asset bundle contains the sprite as expected
    * The "materials" asset bundle contains both the material and a copy of the sprite, but there must not be a copy of the sprite inside the materials bundle.

    Additional info:
    * What's interesting is that the "materials" asset bundle Manifest does not indicate the presence of the sprite, but
    * if the material and the sprite from both bundles are loaded, for example, in the Android Player during runtime, in the Profiler you will see 2 copies of the sprite loaded in memory.

    Note: This issue looks similar to this one:
    https://issuetracker.unity3d.com/is...will-be-included-in-the-materials-assetbundle

    but it does not seem fixed. We have successfully reproduced our issue with both Unity 2019.1.12 and 2018.2.21