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

Does anyone experiencing different asset bundle output than previously in Unity 2021.1?.

I have the following code :

                if (GUILayout.Button("Lite") && DrawedIds.Count != 0)
                {
                    string BundleFile = System.IO.Path.Combine(Environment.CurrentDirectory + "/", Sub.Name + ".bundle");
                    List<UnityEngine.Object> Assets = new List<UnityEngine.Object>();
                    Sub.GetAssets(Assets, this);
                    Debug.Log("Files:" + Assets.Count + ", Saving Bundle:" + BundleFile);
                    BuildPipeline.BuildAssetBundle(null,
                        Assets.ToArray(),
                        BundleFile,
                        BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets | BuildAssetBundleOptions.ChunkBasedCompression,
                        UnityEditor.EditorUserBuildSettings.activeBuildTarget);
                    EditorUtility.RevealInFinder(BundleFile);
                }

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.

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.

2 Likes

@Ryanc_unity
Reported as case id 1362999

1 Like