Search Unity

AssetBundles not downloading problem

Discussion in 'Web' started by Diet-Chugg, Jul 9, 2015.

  1. Diet-Chugg

    Diet-Chugg

    Joined:
    Jul 4, 2012
    Posts:
    51
    I have been trying to get asset bundles to work on WebGL using the new system from this video:


    I went through my project and marked all my assetBundles. I'm not using variants.

    I use this code to build my asset bundles:
    Code (CSharp):
    1. BuildPipeline.BuildAssetBundles("WebGL",BuildAssetBundleOptions.None,BuildTarget.WebGL);
    I then attempt to download my manifest file so I can find dependencies

    Code (CSharp):
    1. IEnumerator ManifestSetup()
    2.     {
    3.         WWW wwwManifest = new WWW("http://www.featuresandbugs.com/waterford/WebGLAssetBundles/WebGL");
    4.         yield return wwwManifest;
    5.  
    6.         if (wwwManifest.error.IsNotNullOrEmpty())
    7.         {
    8.             Debug.LogError(wwwManifest.error);
    9.         }
    10.  
    11.         AssetBundle manifestBundle = wwwManifest.assetBundle;
    12.         if (manifestBundle == null)
    13.             Debug.LogError("No manifestBundle found");
    14.  
    15.         //string[] assetNames = manifestBundle.GetAllAssetNames();
    16.         Debug.Log("asdf");
    17.         Debug.Log("Name: " + GetCurrentPlatformBundleData().name);
    18.         manifest = manifestBundle.LoadAsset(GetCurrentPlatformBundleData().name) as AssetBundleManifest;
    19.         Debug.Log("Unload Time");
    20.         manifestBundle.Unload(false);
    21.         Debug.Log("Unload completed");
    22.  
    23.     }
    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:
    1. (Called from my code):
      Invalid Unity Web File (Decompression Failure). URL: http://www.featuresandbugs.com/waterford/WebGLAssetBundles/WebGL

    2. (UnityError):
      The unity3d file is not a valid AssetBundle.
    3. (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
     
    Last edited: Jul 9, 2015
  2. Diet-Chugg

    Diet-Chugg

    Joined:
    Jul 4, 2012
    Posts:
    51