inputPath | 要再压缩的 AssetBundle 的路径。 |
outputPath | 要生成并再压缩的 AssetBundle 的路径。可能与 inputPath 相同。 |
method | 在再压缩期间使用的压缩方法、级别和块大小。仅支持一部分 BuildCompression 类型(请参阅注意事项)。 |
expectedCRC | 要作为测试依据的 AssetBundle CRC。进行此测试需要额外的文件读取和计算。传入 0 可跳过此检查。当源和目标 BuildCompression 相同时,Unity 不计算 CRC,因此不会发生任何 CRC 验证(请参阅注意事项)。 |
priority | 应该执行再压缩操作的优先级。这会设置操作期间的线程优先级,而不影响执行操作的顺序。再压缩操作在后台工作线程上运行。 |
异步将下载/存储的 AssetBundle 从一个 BuildCompression 再压缩为另一个。
方法必须是名称以 Runtime 结尾的 BuildCompression,例如 LZ4Runtime,否则会抛出 ArgumentException。 当目标 BuildCompression 与源相同时,这会成为内部复制操作,Unity 不计算未压缩数据的 CRC。这种情况下,如果传入非零 expectedCRC,则会引发警告,并且不会发生 CRC 验证。
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.