Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. On February 28th the Feedback website will shut down and be redirected to the Unity forums. See the full post for more information.
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Unity 2018.3 is now released.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

BuildPipeline.BuildAssetBundles doesn't include all assets.

Discussion in 'Asset Bundles' started by trackOfer, Jan 17, 2019.

  1. trackOfer

    trackOfer

    Joined:
    Dec 27, 2017
    Posts:
    9
    I wrote a small editor script that is suppose to include about 400 files inside the asset bundle.
    Eventually it only include 20 DDS files out of the 400, 200 of those files are my own custom format.
    Are asset bundles limited somehow with the size and formats it support?
    I don't understand why the code builds an AB with only 20 or so files.

    Code (CSharp):
    1. [MenuItem("Assets/Build AssetBundle")]
    2.     static void ExportResource()
    3.     {
    4.         string path = "Assets/myAssetBundle.unity3d";
    5.  
    6.         AssetBundleBuild[] buildMap = new AssetBundleBuild[1];
    7.  
    8.         buildMap[0].assetBundleName = "Boxers";      
    9.         string[] enemyAssets = new string[197*2];
    10.         for (int i=0; i<197; i++)
    11.             enemyAssets[i] = "Assets/Boxers/meshWithTexture"+(i+1)+".trs";
    12.         for (int i = 0; i < 197; i++)
    13.             enemyAssets[i+197] = "Assets/Boxers/meshWithTexture" + (i + 1) + ".dds";
    14.         buildMap[0].assetNames = enemyAssets;
    15.  
    16.         BuildPipeline.BuildAssetBundles("Assets/ABS", buildMap, BuildAssetBundleOptions.None, BuildTarget.WebGL);
    17.     }
     
  2. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    3,143
    I believe asset bundles must not exceed 4GB in size, just like resources. Unfortunately, I didn't find any official documentation regarding any asset bundle filesize limit.
     
    alpha_rat likes this.
  3. trackOfer

    trackOfer

    Joined:
    Dec 27, 2017
    Posts:
    9
    It didn't exceed 4 GB though. every DDS file is about 2.5 MB and I have only 200 of those. The TRS are only 600KB and also only 200 of those