Search Unity

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:
    829
  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.