Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

LoadAssetAsync<IList<Sprite>> throws error in packed mode.

Discussion in 'Addressables' started by IEdge, Jul 7, 2019.

  1. IEdge

    IEdge

    Joined:
    Mar 25, 2017
    Posts:
    28
    Hi, I using LoadAssetAsync<IList<Sprite>>("blablabla") to load all sprites from spritesheet, it works properly on fast and virtual mode, but in packed mode I get 3 log errors (on build just crash):

    Assertion failed on expression: 'CurrentThreadIsMainThread()'
    GetGfxDevice() should only be called from main thread
    Assertion failed on expression: 'CurrentThreadIsMainThread()'


    What I doing wrong here?
     
    Last edited: Jul 7, 2019
  2. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    967
  3. IEdge

    IEdge

    Joined:
    Mar 25, 2017
    Posts:
    28
    Hi @unity_bill.

    For now I found an alternative solution, I had to serialized each frame of each spritesheet into a sriptable object, and finally load without problems. My project use +700 spritesheets.

    I will be awaiting for the updates. Thank you.
     
    Last edited: Jul 21, 2019
  4. zhengying

    zhengying

    Joined:
    Nov 21, 2015
    Posts:
    12
    Same problem in 2018.4.5f1.
     
  5. zhengying

    zhengying

    Joined:
    Nov 21, 2015
    Posts:
    12
    Just test in the latest Unity, not fixed in 2018.4.6f1.
     
  6. zhengying

    zhengying

    Joined:
    Nov 21, 2015
    Posts:
    12
    I don't known why Addressable plugin is already in stable version but threre are critical bugs exist;

    LoadAssetAsync<IList<Sprite>> is so foundational function.
    But We can't use it...
     
  7. IEdge

    IEdge

    Joined:
    Mar 25, 2017
    Posts:
    28
    As unity_bill said: "It should be fixed in 2019.3.0a9 and 2019.2.something."

    I don't know if it's already fixed for 2019.2 / 2019.2.1. Maybe you can try latest unity version.

    Regards.
     
    unity_bill likes this.
  8. zhengying

    zhengying

    Joined:
    Nov 21, 2015
    Posts:
    12
    thanks @IEdge
    Maybe, but I can't switch project to unity2019 now. I wait for them fix it in unity2018.
     
  9. ctapp1

    ctapp1

    Joined:
    Jan 11, 2016
    Posts:
    6
    Can anyone confirm what version of Unity this has been fixed on? It is still happening on 2019.1.11 for me.
     
  10. KB73

    KB73

    Joined:
    Feb 7, 2013
    Posts:
    197
    It works for us - be mindful of whether you pass in a string for the asset or an IResourceLocation, the latter returns an array with 2 elements, 1 of which is a Texture2D the other is the sprite

    We are on 2019.2.9
     
  11. ctapp1

    ctapp1

    Joined:
    Jan 11, 2016
    Posts:
    6
    Updated to 2019.2.11 and it worked, thanks