图集
使用步骤:
1. 检查Sprite Packer 是否为 Always Enabled。
位置 Edit->Projects Settings->Editor
Always Enabled 意思是一直能用(packing is enabled for both Play mode and builds)
Disabled意思是不能用
Enabled for builds 意思是打包时可用(packing is used for builds but not Play mode)。
如下图
UGUI 学习笔记 1 图集
2. 设置图片格式
选中图片在Inspector中设置参数
Texture Type为Sprite(2D and UI)
Packing Tag为 图集的名字
Filter Mode 为 Bilinear
Format 为 Truecolor
UGUI 学习笔记 1 图集
3. 查看图集
Windows->Sprite Packer点击pack
4. 使用方式
和NGUI Texture绑定图片的方法一样。
5. 注意事项
图片放在Resources文件夹下不能打包成图集
注意同一图集只消耗同一个draw call
图集缓存在Project\Libray\AtlasCache中
图集的默认最大尺寸 2048X2048
6. 和NGUI的区别
NGUI中为了方便控件使用图片,UGUI是针对Draw call 和Batches的优化

相关文章: