I have been trying to get asset bundles to work on WebGL using the new system from this video:
Unity5 New AssetBundle System
I went through my project and marked all my assetBundles. I’m not using variants.
I use this code to build my asset bundles:
BuildPipeline.BuildAssetBundles("WebGL",BuildAssetBundleOptions.None,BuildTarget.WebGL);
I then attempt to download my manifest file so I can find dependencies
IEnumerator ManifestSetup()
{
WWW wwwManifest = new WWW("http://www.featuresandbugs.com/waterford/WebGLAssetBundles/WebGL");
yield return wwwManifest;
if (wwwManifest.error.IsNotNullOrEmpty())
{
Debug.LogError(wwwManifest.error);
}
AssetBundle manifestBundle = wwwManifest.assetBundle;
if (manifestBundle == null)
Debug.LogError("No manifestBundle found");
//string[] assetNames = manifestBundle.GetAllAssetNames();
Debug.Log("asdf");
Debug.Log("Name: " + GetCurrentPlatformBundleData().name);
manifest = manifestBundle.LoadAsset(GetCurrentPlatformBundleData().name) as AssetBundleManifest;
Debug.Log("Unload Time");
manifestBundle.Unload(false);
Debug.Log("Unload completed");
}
I make a WebGL build and build my asset Bundles in the same project and version of Unity3d. I upload my asset bundles and build to the same folder on the same server. When I go to this link http://www.featuresandbugs.com/waterford/WebGLAssetBundles/WebGL my WebGL file downloads just fine.
"When I run this on Chrome or Firefox I get three errors:
(Called from my code): Invalid Unity
Web File (Decompression Failure).
URL:
http://www.featuresandbugs.com/waterford/WebGLAssetBundles/WebGL
(UnityError):
The unity3d file is not a valid AssetBundle.
(Called from my code):
“No manifestBundle found”
What can I do to get a proper download of these files? Thanks for the help!
[Edit] Cleaned up formatting, title and wording a bit. Clarified calls on errors