Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Sprite Atlas white sprites problem

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

  1. AndersonDev

    AndersonDev

    Joined:
    Dec 13, 2015
    Posts:
    100
    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:
    100
    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:
    100
    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:
    1,005
    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:
    100
    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.
unityunity