I'm confused by the documentation for LoadAllAssetsAtPath. It reads:
*Returns an array of all asset objects at assetPath.
Some asset files may contain multiple objects (such as a Maya file which may contain multiple Meshes and GameObjects). All paths are relative to the project folder. Like: "Assets/MyTextures/hello.png"*
I know some assets contain multiple objects. Would a path such as:
load all the assets under BunchOfStuff recursively? It doesn't appear so. When I call:
As a path that contains child assets, I get two Objects returned. It doesn't matter if there are more assets under that part or no assets at all. Always 2 are returned. I'm not sure what they are.
I'm trying to script an automated build for a bunch of asset bundles containing a large amount of content (text and images). I don't want to have to enumerate all the assets I want included in the case where every asset should be included. I've seen the simplified example scripts but I've not seen any yet that handle a bunch of assets.
asked Aug 03 '10 at 08:01 PM
AssetDatabase.LoadAllAssetsAtPath() only works if you specify the path of a single object. It will load all the assets that are children of that asset.
It sounds like you want to use Resources.LoadAll(path), which will load all the assets at the specified relative path inside any folder named "Resources" (you might have to rename/rearrange your project hierarchy)
You can just list all files usung file listing and load them one by one: