构建播放器时使用基于语块的 LZ4 压缩。
此值允许您在将播放器部署到设备时以压缩形式存储数据。系统将在播放器读取数据时实时执行解压缩。与使用未压缩数据相比,场景或资源加载有快有慢,具体取决于磁盘读取速度。
压缩数据文件包括:
1.播放器设置 -“globalgamemanagers”和“globalgamemanagers.assets”文件。
2.场景和资源 -“level*”和“sharedassets*.asset”文件。
3.资源 -“resources.assets”文件。
4.GI 数据。
5.内置资源 -“unity_builtin_extra”文件。
CompressWithLz4 会将压缩参数设置为 LZ4 压缩,并将数据文件拆分成 128KB 数据块。
此功能适用于 Standalone、Android 和 iOS 构建目标,是 WebGL 目标的默认选项。
加载数据时,在 Android 中启用 CompressWithLz4 可能会显著提升性能,因为 LZ4 解压缩比默认的 Zip 解压缩要快。
注意:
压缩可能会影响游戏安装程序的大小,使其变得更大,即使设备上的播放器更小也是如此。后续压缩的效率较低,甚至无法压缩。
另请参阅:BuildAssetBundleOptions.ChunkBasedCompression、AssetBundles-Building、ReducingFilesize。
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.