Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Bug (case 1362999)BuildPipeline.BuildAssetBundle behaving differently than on Unity 2021.1?

Discussion in '2021.2 Beta' started by siliwangi, Aug 17, 2021.

  1. siliwangi

    siliwangi

    Joined:
    Sep 25, 2009
    Posts:
    303
    Does anyone experiencing different asset bundle output than previously in Unity 2021.1?.

    I have the following code :
    Code (csharp):
    1.  
    2.                 if (GUILayout.Button("Lite") && DrawedIds.Count != 0)
    3.                 {
    4.                     string BundleFile = System.IO.Path.Combine(Environment.CurrentDirectory + "/", Sub.Name + ".bundle");
    5.                     List<UnityEngine.Object> Assets = new List<UnityEngine.Object>();
    6.                     Sub.GetAssets(Assets, this);
    7.                     Debug.Log("Files:" + Assets.Count + ", Saving Bundle:" + BundleFile);
    8.                     BuildPipeline.BuildAssetBundle(null,
    9.                         Assets.ToArray(),
    10.                         BundleFile,
    11.                         BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets | BuildAssetBundleOptions.ChunkBasedCompression,
    12.                         UnityEditor.EditorUserBuildSettings.activeBuildTarget);
    13.                     EditorUtility.RevealInFinder(BundleFile);
    14.                 }
    15.  
    In Unity 2021.1 the asset bundle file that is created around 520 MB while the same code in Unity 2021.2b7 is only 120 MB.
     
  2. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    332
    I haven't seen any code changes that would explain this behavior on the asset bundle side of things. Can you please file a bug report and we will look into it.
     
    siliwangi and LeonhardP like this.
  3. siliwangi

    siliwangi

    Joined:
    Sep 25, 2009
    Posts:
    303
    LeonhardP likes this.