Search Unity

Is progress in AssetBundleCreateRequest AssetBundle.LoadFromMemoryAsync(bytes) broken?

Discussion in 'Asset Bundles' started by Muzlu, Jul 19, 2018.

  1. Muzlu

    Muzlu

    Joined:
    Feb 4, 2015
    Posts:
    12
    Hi,
    I'm trying to get progress of LoadFromMemoryAsync(bytes[]) function to update progress bar on bundle load/download. Is it broken? I have only value = 0 when is loading and 1 when is finished.
    progress on www works as it should.
    My code: (maybe I'm making something wrong)
    Code (CSharp):
    1. AssetBundleCreateRequest myRequest = AssetBundle.LoadFromMemoryAsync(www.bytes);
    2.    
    3.         while(!myRequest.isDone)
    4.         {
    5.             //TODO: Progress bar.
    6.             //myRequest.progress is always 0 here
    7.             yield return null;
    8.         }
     
  2. dklee7

    dklee7

    Joined:
    Jun 13, 2018
    Posts:
    1
    I am having the same issue as you... Here's what I'm trying:

    Code (CSharp):
    1.  
    2. var request = AssetBundle.LoadFromMemoryAsync(decryptedBytes);
    3.  
    4. while (!request.isDone)
    5. {
    6.     Debug.Log("request progress: " + request.progress);
    7.     LoadingBar.size = request.progress;
    8.     LoadingBar.GetComponentInChildren<Text>().text = (int)(request.progress * 100f) + "%";
    9.     yield return null;
    10. }
    11.  
    This process usually takes 5-10 seconds on a HoloLens, but I only get 1, or 2 print statements of 0. Progress bar never moves and the text never changes.