Search Unity

Sprite Atlas white sprites problem

Discussion in 'Addressables' started by AndersonDev, Jul 17, 2019.

  1. AndersonDev

    AndersonDev

    Joined:
    Dec 13, 2015
    Posts:
    70
    Hi! Let's describe a problem:
    • I've imported 3 sprites for 3 button states
    • I've added new SpriteAtlas and put folder with 3 sprites in "Objects for Packing"
    • Made a scene with UI Button
    • Binded 3 sprites to different Button states (sprite swap)
    • Builded Player Content
    • Run game in Packed Play Mode (with hosted service)
    • Loaded that scene via Addressables
    • After load I can see button with image
    • After press, sprite converted to white one
    • After loading another scene and go back to previous one, all Images was white
    Bundle Browser shows images and atlases in bundle.
     

    Attached Files:

  2. AndersonDev

    AndersonDev

    Joined:
    Dec 13, 2015
    Posts:
    70
    Moreover, I had code like this:
    Code (CSharp):
    1.  IconsHandle = Addressables.LoadAssetsAsync<Sprite>(new List<object>(Icons), null, Addressables.MergeMode.Union);
    2.         IList<Sprite> icons = await IconsHandle.Task;
    3.  
    4. IconPrefab.InstantiateAsync(iconPosition, Quaternion.identity).Completed += icon =>
    5.                 {
    6.                     icon.Result.transform.SetParent(ReelsContainer, false);
    7.                     icon.Result.GetComponent<SpriteRenderer>().sprite = iconToInstantiate;
    8.                 };
    If Icons are just Addressables, all work nice. But if I place one of that icons on scene and rebuild bundles, that icon will be broken:
    upload_2019-7-17_13-38-7.png

    Looks like problem with dependency packing.
     
  3. AndersonDev

    AndersonDev

    Joined:
    Dec 13, 2015
    Posts:
    70
    That problem occurs only after switching scenes with:
    Code (CSharp):
    1. Addressables.LoadSceneAsync(Name + "/Scenes/MainScene");
    Also I have:
    upload_2019-7-17_16-59-38.png

    P.S. After building for macOS, problem from post 1 disappeared, left only problem with shaders after scene switch. Problem in Editor still the same.
     
  4. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    849
    Can you file a bug against Unity with a repro project? We've seen some similar issues elsewhere, but having your repro will really help us get to the bottom of this.
     
  5. AndersonDev

    AndersonDev

    Joined:
    Dec 13, 2015
    Posts:
    70
    I sent a report. There is lack of Zenject of last version to be workable and maybe some project settings. Let me know if you need something more. Case 1170466.
     
    unity_bill likes this.