当前的 Sprite Atlas 将纹理(来自精灵、纹理内的精灵和文件夹中的精灵)打包为一个图集纹理。进入运行模式时,或者构建播放器或 AssetBundle 时,它会打包这些纹理。
To configure the packing behavior, go to Edit > Project Settings > Editor > Sprite Packer and select an option from the Mode drop-down menu.
AssetDatabase V1 不能有依赖项,也不支持命名对象的导入器,所以 Unity 通过自定义机制打包其精灵图集,并将纹理的输出数据和渲染数据存储在 Library/AtlasCache 文件夹中。
However, Sprite Atlas version 1 does not support the Cache Server. Unity can only cache Artifacts (data generated through the import process) stored in the Library folder. As it does not use an importer, the current system cannot use some of the functionalities exposed by AssetDatabase V2 (ADBV2) such as:
Cache Server support
Lazy/Background importing
Multi-process Asset import
版本 2 实验性系统的开发遵循以下标准:
使用支持缓存服务器和其他 ADBV2 功能的导入器工作流。
Sprite Atlas 运行时对象没有变化。
确保存在将当前精灵图集迁移到 Sprite Atlas 版本 2 的路径。
UX 工作流程没有重大变化。
除了以下内容外,与 Sprite Atlas 版本 1 相比,Inspector 属性和设置没有变化:
You cannot drag a folder directly onto Objects for Packing to add the contents for packing in Sprite Atlas v2, however dragging Sprites and Textures directly onto the window is still supported.
导入的 Sprite Atlas 对象显示在 Inspector 的底部。
To enable the experimental Sprite Atlas v2 mode, go to Edit > Project Settings > Sprite Packer, open the Mode drop-down menu and select Sprite Atlas V2 (Experimental) - Enabled.
当您启用实验性 Sprite Atlas 版本 2 时:
It becomes the default Mode when you create a Sprite Atlas through the Assets menu (Assets > Create > Sprite Atlas).
Unity 自动将所有现有的 Sprite Atlas 版本 1 资源迁移到 Sprite Atlas 版本 2。
由于自动迁移,您应该在启用 Sprite Atlas 版本 2 之前备份版本 1 的精灵图集。转换为版本 2 的资源与版本 1 不兼容,无法转换回来。
目前不支持通过脚本编辑 Sprite Atlas 版本 2。
*Sprite Atlas 版本 2(实验性)添加于 2020.1 NewIn20201
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.