在构建的应用程序中,Unity 存储多个压缩的着色器在 GPU 上运行的程序。 更多信息
参见 术语表变体数据“块”。每个块包含多个着色器变体。当 Unity 在运行时加载场景场景包含游戏环境和菜单。可以将每个唯一的场景文件视为一个唯一的关卡。在每个场景中,您放置环境、障碍物和装饰,从本质上讲,将游戏分段设计和构建。 更多信息
参见 术语表时,它会将场景的所有块加载到 CPU 内存中并对其进行解压缩。
为了减少内存有限平台上的内存使用量,您可以限制块的大小以及 Unity 保留在内存中的解压缩块的数量。
为此,在播放器设置允许您为 Unity 生成的最终游戏设置各种特定于播放器的选项的设置。 更多信息
参见 术语表中,选择其他设置 > 着色器变体加载并调整以下设置
0
,这意味着没有限制。有关更多信息,请参阅PlayerSettings.SetDefaultShaderChunkCount。
您可以使用覆盖为每个平台单独覆盖这些值。有关更多信息,请参阅PlayerSettings.SetShaderChunkCountForPlatform。
您还可以使用Shader.maximumChunksOverride在运行时覆盖默认块计数。
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.