I just downloaded Unity 5 and was hoping to use the now freely available Asset Bundles to programmatically create AssetBundles from files not imported into Unity. However, I have yet to find a way to actually do this.
I would like for the Bundles to be created quickly and with as little hassle as possible, as this would need to happen “in real-time” to push content on the fly. Let me quickly sketch the workflow I am hoping to accomplish:
Do some stuff to a bunch of images outside of Unity
Store these images at /Users/example/project/images/batch1
In Unity, create a simple wizard that lets me select “batch1”
Have Unity fetch all images in the batch1 folder through WWW requests and add them to a new AssetBundle (named batch1.unity3d e.g.)
Export the AssetBundle
The step I am now stuck at is adding the WWW’d assets to a new AssetBundle. Going through the documentation I keep finding myself reading about asset importers, but if at all possible I would like to skip this step. Is there any way at all for me to do so?
Everything up to and including "In Unity, create a simple wizard that lets me select “batch1"”
Copy the required files from this folder into the unity project folder, then use AssetDatabase.ImportAsset to start the import process.
Create an AssetBundleBuild object that points to the imported files in the project folder.
Use BuildAssetBundles (Second variant in documentation) to build the assetbundle.
I’m not sure why you’d involve www in this process, unless you’re trying to do assetbundles outside the editor, which isn’t possible. (with any built-in functionality anyway, as all this functionality lies within the UnityEditor namespace)
The reason I was hoping to use WWWs is so I can keep all the images outside of the Unity folder and just load them in and use them for my purpose. In this case, I would like to load in the images and create Sprite objects with said images as their textures. Currently I am doing this at runtime in my game, but the loading time is pretty high, and my guess (hope) is that I can reduce this loading time by quite a bit by using AssetBundles.
Temporarily copying the files sounds like it might be a good work-around though; I’ll give that a try. Thanks!