Is there a unified method for loading assets?

We need the app size to be below 50MB when the user downloads it for the first time (mobile app, from the App Store), and then we load the rest of the resources from our private server.

My understanding is that this will put our resources into two different locations, and therefore the loading mechanism is a little different for each.

As I understand Unity3D, at this stage of my studies, there are two primary ways to load assets in Unity:

  • WWW.LoadFromCacheOrDownload()
  • AssetBundle.Load()

My understanding is that I would use AssetBundle.Load() for those assets that are included in the application binary package. If there is an asset bundle, perhaps with a new game level and creatures, then I could grab that (say from a server) via LoadFromCacheOrDownload().

Subsequently, resources can become split into two piles:

  • Assets > Resources folder
  • the local cache

The result of this seems to be that the loading mechanism is dependent upon where the resource lives physically on the disk. This strikes me as a little bit strange: a resource is a resource, just load the darn thing.

As such, it seems to me that every time I load a resource, perhaps as dictated by a server-side XML file with a level construction recipe, I have to check every resource for existence in both places. It might be a static file, it might have been dynamically downloaded and cached, and it may not be known at compile time what combination of things will be combined and displayed to the player.

I want to be able to build scripts that don’t have to worry about this level of detail. I just want to load the resource if it is exists, no matter where it exists, and use it.

Is my understanding of this situation accurate?
If so, is there a standard Unity call that achieves what I’m looking for?
Perhaps my thinking about the entire matter is topsy-turvy. If so, please feel free to call me out on it or question my assumptions.

Thank you.

You got it a bit wrong.

WWW.LoadFromCacheOrDownload() and AssetBundle.Load() are used together.

LoadFromCacheOrDownload works like so:

Check to see if the requested file (by URL and version) is already cached (saved locally).

If it is, load it from there (AssetBundle = download).

If it is not, download it from the URL (AssetBundle = download when download completes).

After the LoadFromCacheOrDownload is done (either from cache or from URL) you use AssetBundle.Load() to load object from the bundle to where you want.

For example:

GameObject go = AssetBundle.Load("something");

I hope I explained everything you wanted.