Search Unity

Feedback 0.6.6 Feedback

Discussion in 'Addressables' started by optimise, Mar 6, 2019.

  1. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    1) Loading behavior is not same at Fast Mode/Packed Play Mode versus Virtual Mode/Real player build. In Fast Mode/Packed Play Mode, if I load ScriptableObject A and ScriptableObject B together and I only check whether ScriptableObject A has been loaded, I will failed to get ScriptableObject B at Virtual Mode/Real player build but success at Fast Mode/Packed Play Mode.

    2) 2 errors after exiting play mode at Packed Play Mode
    upload_2019-3-6_22-57-40.png
     
  2. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    I'm not exactly sure what you are describing. So you do a single Load call with a label for two different objects, then only check that A was loaded, and then later, something else checks that B is loaded and fails?

    Please add some details, and I will help get to the bottom of this.
     
  3. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    No label. Load together like the following code. Actually what I mean fail is at Virtual Mode/Real player build it will load slower. So at somewhere in the code if you didn't check for B, you will get error as B has not been loaded yet. What I really want is to make sure no matter it's Fast Mode/Virtual Mode/Packed Play Mode/Real player build, the loading behavior should have same behavior to avoid developer after testing at Fast Mode and assume real player build will work as expected too.

    Code (CSharp):
    1.  
    2. Addressables.LoadAsset<A>("A").Completed += operation => { };
    3. Addressables.LoadAsset<B>("B").Completed += operation => { };
    4.  
     
  4. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    If I understand correctly, you are triggering a LoadAsset<B>, but then not waiting for it to be complete. You have code that runs later (I'm guessing one frame later) that assumes B is ready to go. In fast mode it is, in real life (player build), it is not.

    Does that sound correct?

    This is not a bug. This is the way asyc systems work. You trigger the system, you have to wait for it to tell you it's done. The reason we have modes like Fast mode is to iterate quickly, and we will not be injecting slow-downs to attempt to match what a real build would be. Virtual mode has some unsophisticated methods to do that sort of thing, but right now they are not very good. Though, to my pleasant surprise, virtual actually did match the real player. So that makes me happy.

    The point of Addressables being async is that you say LoadAsset("B") and you get it when it's done. If it's remote, downloads happen. It's load speed will be dependent on your device, and the size of B. Likewise your download time will vary significantly based on device, connection, and asset size. We cannot make any in-editor mode exactly match reality, because reality is not constant. We've build upon an async model, to handle exactly this.


    Now, as to your number 2. I believe that issue is due to an asset bundle being unloaded at a time when Unity thinks the thing should not be. If you can create a simple repro-project, please make a bug against Unity and put the case number here. We'll look into what exactly is causing it.


    hope that information helps.
    -Bill