Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

Cached asset bundle folder structure

Discussion in 'Asset Bundles' started by unity_SRZXyHN7P3fFcA, Jun 28, 2021.

  1. unity_SRZXyHN7P3fFcA

    unity_SRZXyHN7P3fFcA

    Joined:
    Oct 27, 2019
    Posts:
    8
    Hi,

    I'm new to asset bundles, and got to where I actually download bundles and have them in the cache. Now, I'd like to load them later on into memory using AssetBundle.LoadFromFile(bundlePath).

    But to get the right bundlePath, I had to Path.Combine(Caching.defaultCache.path, bundleName, bundleHash, "__data") because this is the structure bundles get stored in inside the cache folder. FYI, there is another file next to each "__data" file called "__info".

    My question is: is this right? Is this a reliable way to construct the path and load the bundles from files that will work across different platforms? I'm on Unity 2020.3, building for StandaloneOSX, but will build for Android and iOS soon.
     
    Last edited: Jun 30, 2021
  2. unity_SRZXyHN7P3fFcA

    unity_SRZXyHN7P3fFcA

    Joined:
    Oct 27, 2019
    Posts:
    8
unityunity