the atlas is include into prefab when i used the new sprite packer in Unity2018.2.17
I have a sprite named SpriteA and I create a spriteAtlas in project window, then add SpriteA into the spriteAtlas, then, I create a prefab with a spriterenderer refrence SpriteA, and use this api to create Two AssetBundle: AssetBundleBuild[] assetBundleBuilds = new AssetBundleBuild[2]; assetBundleBuilds[1].assetBundleName = "atlasAB"; assetBundleBuilds[1].assetNames = new string[1] { "Assets/Atlas/spriteAtlas.spriteatlas"}; assetBundleBuilds[2].assetBundleName = "prefabAB"; assetBundleBuilds[2].assetNames = new string[1] { "Assets/Atlas/prefab.prefab"};
BuildPipeline.BuildAssetBundles(outputPath, assetBundleBuilds, BuildAssetBundleOptions.None, buildTarget);
The result is the prefabAb has include the spriteatlas,with no dependencies。Another words,the spriteAtlas is duplicated in to the two bundles.
But if I use this BuildPipeline.BuildAssetBundles(outputPath, BuildPipeline.BuildAssetBundles(outputPath, buildTarget) api,and set the spriteA's bundlename and packing tag into a same string, and use the legacy spritepacker, then all thing is right, the prefabAb does not include the spriteatlas, and reference to a dependencie named "atlasAB", Is there any bug with the new api:
public static AssetBundleManifest BuildAssetBundles(string outputPath, AssetBundleBuild[] builds, BuildAssetBundleOptions assetBundleOptions, BuildTarget targetPlatform); ,I have a sprite named SpriteA and I create a spriteAtlas in project window, then add SpriteA into the spriteAtlas, then, I create a prefab with a spriterenderer refrence SpriteA, and use this api to create Two AssetBundle: AssetBundleBuild[] assetBundleBuilds = new AssetBundleBuild[2]; assetBundleBuilds[1].assetBundleName = "atlasAB"; assetBundleBuilds[1].assetNames = new string[1] { "Assets/Atlas/spriteAtlas.spriteatlas"}; assetBundleBuilds[2].assetBundleName = "prefabAB"; assetBundleBuilds[2].assetNames = new string[1] { "Assets/Atlas/prefab.prefab"};
BuildPipeline.BuildAssetBundles(outputPath, assetBundleBuilds, BuildAssetBundleOptions.None, buildTarget);
The result is the prefabAb has include the spriteatlas,with no dependencies。Another words,the spriteAtlas is duplicated in to the two bundles.
But if I use this BuildPipeline.BuildAssetBundles(outputPath, BuildPipeline.BuildAssetBundles(outputPath, buildTarget) api,and set the spriteA's bundlename and packing tag into a same string, and use the legacy spritepacker, then all thing is right, the prefabAb does not include the spriteatlas, and reference to a dependencie named "atlasAB", Is there any bug with the new api:
public static AssetBundleManifest BuildAssetBundles(string outputPath, AssetBundleBuild[] builds, BuildAssetBundleOptions assetBundleOptions, BuildTarget targetPlatform);
Your answer
Follow this Question
Related Questions
Dynamically create Sprite Atlas during runtime for DLC 0 Answers
Align the bottom of a sprite to the bottom of a collider 0 Answers
Workflow for TextMesh Pro sprite glyphs? 1 Answer
Particle Texture Sheet Animation Module reference to Sprite Packer Atlas 2 Answers
Sprite Atlas bug on Android 6? 0 Answers