Search Unity

Does Scene Asset Bundle load dependences automatically?

Discussion in 'Asset Bundles' started by hromoyDron, Aug 20, 2019.

  1. hromoyDron

    hromoyDron

    Joined:
    Jan 24, 2013
    Posts:
    71
    Hello!

    I notice if there is bundle (B1) with gameObject (g1). And this bundle has dependences on another bundle (B2) with gameObject(g2). And g1 have reference in his component to g2. So after loading reference in g1 will lead to g2.

    But if B1 is bundle where is scene with g1, and I load scene. Reference in g1 will be null.


    So why it is null?
    Does dependences loads only for non scene bundles?

    Code (CSharp):
    1.  
    2. var uwr = UnityWebRequestAssetBundle.GetAssetBundle(url);
    3.  
    4. UnityWebRequestAsyncOperation uwrao = uwr.SendWebRequest();
    5.  
    6. while(!uwrao.isDone)
    7. {
    8.     progress = uwrao.progress;
    9.     yield return null;
    10. }
    11.  
    12.  bundle = DownloadHandlerAssetBundle.GetContent(uwr);