延迟绑定是通过 精灵图集 API 在运行时加载或替换 精灵图集一种实用工具,将多个精灵纹理紧密地打包到一个称为图集的单一纹理中。 更多信息
参见 术语表 的过程。当图集在启动时不可用时,例如从 资源包 加载资源时,这很有必要。您可以选择根据特定条件绑定 不同的精灵图集,例如加载不同平台的高分辨率或低分辨率 精灵2D 图形对象。如果您习惯于使用 3D,则精灵本质上只是标准纹理,但存在用于组合和管理精灵纹理以提高开发效率和便捷性的特殊技术。 更多信息
参见 术语表 图集,以提高性能和效率。
在您 将精灵打包到项目中的精灵图集 后,您可以决定是否要 将精灵图集包含在已发布的构建中。要将精灵图集从构建中排除,请清除精灵图集属性中的“包含在构建中”。如果未包含在构建中,则不会在运行时加载精灵图集,并且引用打包到图集中的纹理的精灵将显示为空白,直到您使用延迟绑定加载该图集。请注意,这也意味着 Unity 编辑器不会自动加载精灵图集,并且当您进入播放模式时,您的精灵将显示为空白。
您可以在 2D 公共 包的“示例”选项卡中下载使用精灵图集和延迟绑定的不同方法和场景的附加示例。
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.