In other words, if two different Objects are assigned to two different AssetBundles, but both have references to a common dependency Object, then that dependency Object will be copied into both AssetBundles.
Depending which signature of BuildPipeline.BuildAssetBundles is called, an Asset is “explicitly assigned” either by setting the Asset’s AssetImporter.assetBundleName property to a non-empty string, or by listing it in AssetBundleBuild.assetNames.Īny Object that is part of an Asset that is not explicitly assigned in an AssetBundle will be included in each AssetBundle that contains any Objects that reference it. The Objects inside an Asset that is explicitly assigned to an AssetBundle will only be built into that single AssetBundle. This dependency information is used to determine the set of Objects that will be included in an AssetBundle.Īssignment to AssetBundles happens at the Asset level. Unity’s AssetBundle system will discover all dependencies of an Object when the Object is built into an AssetBundle. This section describes several problems that commonly appear in projects using AssetBundles.