I have created an AssetBundle with one scene but I don’t know how to load it with the new Asset bundle system?
Is it right?
using (WWW download = new WWW(“AssetBundleName”))
{
yield return download;
if (download.error != null)
Debug.LogError(“WWW download had an error:” + download.error);
var bundle = download.assetBundle;
}
Application.LoadLevel(“SceneName”);
Don’t think AssetBundles support scenes. Use the asset bundle to store all the assets, and just have a scene in the project with no assets in it.
Asset bundles can contain scenes (possibly only 1 scene per bundle, but definitely allows scenes).
As for your code, it looks correct. The only problem is the URL being used in the WWW request - “AssetBundleName” is not a URL. “file:///some/path/to/file/AssetBundleName” is more along the lines of what you would want to use.
Apart from that it should work fine (assuming you have created the asset bundle correctly and put it in the right place).
1 Like
Wow. I am such a beginner!