🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Problems using AssetBundle Load() in Unity 3.5.5

Started by
0 comments, last by lazybearsoft 3 years, 11 months ago

So, I am having a problem loading assets from AssetsBundles using Load(), but LoadAll() works fine. I have some ideas about why this might be, and will get into the details shortly. The first thing I want to mention, is that I am stuck with using Unity 3.5.5, due to the fact that I am using an existing codebase and assets of considerable size that would be WAY too hard to upgrade.
I do not have the original assets separately....I have to access them by using the CustomAssetBundles that were retrieved from cache. The process is, 1) add .asset extension to CAB file. 2) drag renamed file into Unity project tab. 3) select all assets within the CAB, then run the script to create AssetBundle (.unity3d file) from these assets. (see the screen shot)

Now for the problem: if I try to do a single-asset load using the AssetBundle Load() method on the asset bundle I just created, it fails. But if I use LoadAll() instead, and loop thru all the returned objects, I can access them all. However, this is not a very efficient thing to have to do when all you need are a single or few assets.
Now, I assume the reason for Load() failing has something to do with the fact that these assets were created in the bundle in some kind a heirarchy: the CAB name is like the root, and all the assets are considered to be 'under' that. Yet, there seems to be no way I can find to use paths in the argument for Load(), such as Load("<CAB name>/<asset name>"); does not work.....and neither does Load("<assetname>"). Interestingly, the only thing I can find with the Load() method is the 'root' itself that is named for the CAB file.

Now, if I had some way to extract the assets from the CABS so that I have them individually, I could create the asset bundle from those without having the CAB as a root.....problem is, I have yet to find a tool that can correctly extract all the assets types I need (such as prefabs) from a Unity 3.5.5 project.
So, I am hoping some Unity guru out there that is familiar with version 3.x can point out a solution that I haven't been able to find myself. Thanks!

This topic is closed to new replies.

Advertisement