Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  4. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

SpriteAtlas Late Binding with UGUI

Discussion in 'Unity UI & TextMesh Pro' started by TheValar, Dec 21, 2017.

  1. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    723
    In order to properly use a SpriteAtlas with AssetBundles you need to register to the atlasRequested event from SpriteAtlasManager and provide the SpriteAtlas once you load it. I believe I am doing this correctly but just end up with all of my UI being white squares.

    I've read elsewhere that UGUI Images do not support late binding but they none of those posts were recent and I'm hoping this has been fixed by now and I'm just missing something. Has anyone successfully done this for UGUI Images or know of a workaround?
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    2,946
    Are you sure this is the case? i am not familiar with SpriteAtlasManager since it's probably an addition to one of the more recent versions of Unity, but is this really the way you're supposed to work with it?

    In the past, if you packed sprites into an atlas, they would already be included in the asset bundle so you don't have to do any manual resolving yourself.

    Also, from the docs:
    I am not sure how can you get a scenario where a sprite was packed into an atlas but it wasn't included in the build (or is that a feature of the new sprite atlas system?)
     
  3. watsonsong

    watsonsong

    Joined:
    May 13, 2015
    Posts:
    273
  4. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    723
    Nope never found a solution for this :( Also have not heard anything about when this might be fixed. It kinda seems to me that Unity has abandoned UGUI for the time being
     
  5. GoodCatchUnity1

    GoodCatchUnity1

    Joined:
    Mar 12, 2018
    Posts:
    2
    Anyone found any more information regarding Late binding with UGUI?

    We are in a situation where late binding works correctly on our Android devices but we get white squares on iOS.

    Any help would be immensely appreciated!
     
  6. liangpengcheng

    liangpengcheng

    Joined:
    Nov 19, 2016
    Posts:
    2
    disable ugui gameobject when instanced, enable it in next frame
     
  7. GoodCatchUnity1

    GoodCatchUnity1

    Joined:
    Mar 12, 2018
    Posts:
    2
    Thanks @liangpengcheng, however we are not instantiating our gameobjects but instead we are having them start in the scene and get their Image sprite from Late Binding from asset bundles