Search Unity

Where is local content stored?

Discussion in 'Addressables' started by LaneFox, Jan 29, 2021.

  1. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,533
    Unity 2019.4.8f1
    Addressables 1.8.5 (2019.4 verified)

    I believe I'm pointing to the StreamingAssets folder here with the addresses, and it is pulling content from a mapped drive on a freenas.

    Here are the profile paths I'm using:

    Code (csharp):
    1. LocalBuildPath: {UnityEngine.AddressableAssets.Addressables.RuntimePath}
    2. LocalLoadPath: {UnityEngine.AddressableAssets.Addressables.RuntimePath}
    3. RemoteBuildPath: [MappedDriveFolderAddress]
    4. RemoteLoadPath: [MappedDriveFolderAddress]
    But when I run the app, download some bundles (and use them successfully), then look in the application folder... I don't see any bundle files. I just see...

    Code (csharp):
    1. [app]_Data\StreamingAssets\aa
    2.      \catalog.json
    3.      \link.xml
    4.      \settings.json
    So where is the bundle content downloaded to? I logged the LocalBuildPath to the console in the build and see that it does indeed point to the StreamingAssets folder, but there are no bundles there. Something works, magically, but the packages aren't there.

    I need to be able to verify which bundles are available, which bundles are downloaded, where their files are at, what their file size is (which is always ZERO via the API for some reason) so I can manually include specific packages in certain deployments without having to require downloading of the dlc content and build a console for grabbing them at runtime.

    I updated to 1.16 and the behavior is the same. Zero download size, unknown content file locations.
     
    Last edited: Jan 29, 2021
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,822
    Let me bounce this off of the team for a bit of guidance.
     
  3. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    763
    So downloaded bundles are not stored in the local build path. They actually use the Caching system built into the engine. So, in order to figure out where that path is you could log
    Caching.currentCacheForWriting.path
    and that should give you the path to your current cache (you may have to drill down a folder or two to get to the actual bundles depending on your setup).

    Let me know if that helps.
     
  4. dlieu-innogames

    dlieu-innogames

    Joined:
    Oct 24, 2016
    Posts:
    1
    I am having a related issue. So I'm just gonna ask here. We have an app where we include all assets with the app. We used to have caching issues on Android where new version of AssetBundles are stored alongside older versions of the same AssetBundles. That caused our app to take up more and more space.

    The way we solved it, is by comparing the app versions and deleting all the old AssetBundles. Right now I am investigating that part of the code to try to improve it so that we only delete old AssetBundles which has actually changed. Before doing so manually, I wanted to try out 'Cache Clear Behavior = Clear When New Version Loaded'.

    However, after some testing, I found out that there isn't anything in
    Caching.currentCacheForWriting.path
    .

    Has anything changed internally so that nothing is cached in
    Caching.currentCacheForWriting.path
    anymore? Or are we missing some steps to make use of caching? Am I correct to assume from your answer that the cache is only used for downloaded asset bundles?