[UGUI]新版SpriteAtlas

参考链接:

https://www.cnblogs.com/msxh/p/14194756.html

https://blog.csdn.net/qq1090504117/article/details/106250428

https://blog.csdn.net/chezhangliang/article/details/106797144?utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1.base&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1.base

AssetStudio下载:https://github.com/Perfare/AssetStudio/releases

使用AssetStudio可以查看AB包内的资源

测试环境:

1.打包预制体

a.当对界面预制体用到的所有图片,都设置ABName并打包时,可以看到,包内不会包含图片资源,不会发生资源冗余

b.对其中一张图片取消设置ABName,可以看到,发生了资源冗余

2.打包图集

勾选Include in Build:当使用到图集的图片时,unity会自动加载该图集

不勾选Include in Build:需要手动实现加载图集的方法

一般来说,会勾选Include in Build,图集的ABName不需要设置(待测试)。即由unity自动加载图集,而图集的卸载,可以使用AssetBundle.Unload(true)卸载UI预制体,再调用Resources.UnloadUnusedAssets()

原文地址:https://www.cnblogs.com/lyh916/p/15145667.html