Search Unity

Load remote Addressable offline

Discussion in 'Addressables' started by DJacquemin, Sep 12, 2018.

  1. DJacquemin

    DJacquemin

    Joined:
    Jun 19, 2017
    Posts:
    13
    Hi everybody,

    My application load the addressables from a server.
    All addressable load correctly when I'm online but they don't load at all when offline.

    I can see the bundles in the Unity cache.
    isn't the addressables system supposed to load the bundle from the cache when there is no internet connection ?

    I tried to save the IResourceLocator but it's not serializable.

    This is my code for the IResourceLocation :
    Code (CSharp):
    1. Addressables.LoadAssets<IResourceLocation>("ArtistContent", null).Completed += AddressableLoadingFinished;
    And this is where I load my assets :
    Code (CSharp):
    1. Addressables.LoadAsset<Sprite>(file).Completed += (op2) =>
    2.                 {
    3.                     ++assetCounter;
    4.                 };
    Am I supposed to do something else ?

    Thanks
     
  2. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    If everything is cached, then you should definitely be able to load while offline. I've filed a bug, and we'll look into it.

    -Bill
     
  3. LoftySky

    LoftySky

    Joined:
    Mar 30, 2015
    Posts:
    13
    How does one go about seeing 'the bundles in the Unity cache'?
     
  4. DJacquemin

    DJacquemin

    Joined:
    Jun 19, 2017
    Posts:
    13
    I see all my bundles in "\Phone\Android\data\mypackage\files\UnityCache\Shared".
     
  5. LoftySky

    LoftySky

    Joined:
    Mar 30, 2015
    Posts:
    13
    Oh I see, thanks. There's a similar path on Windows that shows the existence of a cache, but there's no indication of what the actual bundles are. As far as I can tell there's no way to tell what bundles you have cached.
     
    Anatolii_Landyshev likes this.
  6. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    Hi, sorry to dig this out, but I have a similar problem and I'm stuck on it since one week :/

    I have posted a question here too :https://forum.unity.com/threads/how...f-the-remote-path-can-not-be-reached.1312521/

    One thing I'm not understanding : how could the local cache be used properly if the Addressables.InitializeAsync() fails and stop the app execution as soon as it can not find the json catalog file online ?

    If someone has a working sample code on how to proceed, I'm interested ;)