Search Unity

2 question about dependence

Discussion in 'Addressables' started by gyx920820, Jan 2, 2019.

  1. gyx920820

    gyx920820

    Joined:
    Oct 8, 2015
    Posts:
    35
    Unity 2018.3 , Addressables 0.5.3, Play Mode Script: Packed Play Mode. Windows standalone.

    "Img" is a prefab. In editor:
    ab2.png
    "2016-05-24" is a sprite

    Question 1:
    If I put "Img" in BundleA, "2016-05-24" in BundleC like this
    ab1.png

    I can't Instantiate Img correctly. The Sprite Renderer miss Sprite. Runtime capture:
    ab3.png

    Code (CSharp):
    1.     void Start()
    2.     {
    3.         _download = Addressables.DownloadDependencies("Img");
    4.         _download.Completed += FinishDownload;
    5.     }
    6.  
    7.     private void FinishDownload(IAsyncOperation obj)
    8.     {
    9.         if (obj.Status == AsyncOperationStatus.Succeeded)
    10.         {
    11.             Addressables.Instantiate<GameObject>("Img").Completed += LoadPrefab;
    12.             Addressables.LoadAsset<TextAsset>("TextLov").Completed += LoadText;
    13.         }
    14.     }
    But if I put "2016-05-24" nowhere, according to the dependence, it will auto be put in BundleA. Then "Img" can be loaded correctly.

    Is this a bug or correct behaviour?


    Question 2:
    As you see, I have bundle A,B,C. Addressables.DownloadDependencies("Img") will download bundleA and BundleC, but not BundleB.
    Normally, we want to download all newest assets at gamestart. Is there a method to do this?

    Thanks.
     
    Last edited: Jan 2, 2019
    MNNoxMortem likes this.
  2. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    1. we've seen some bugs surrounding accessing addressables that were formerly in Resources (as I can see yours is in Resources_moved). That may be related. We should have those bugs fixed in the next release, so please try this again then, and let us know how it goes. If it still fails, a bug report would be best.
    2. currently you can give things a label, and at startup do DownloadDependencies("loading_label"); We intend to add some sort of "DownloadAll" interface at some point.