Version: 2022.1
LanguageEnglish
  • C#

BuildOptions.CompressWithLz4

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Use chunk-based LZ4 compression when building the Player.

This value allows the data to be stored in a compressed form when the Player is deployed to a device. Decompression is performed in real time when the Player reads the data. Scene or Asset loading might be faster or slower depending on disk read speed when compared to using uncompressed data.

Compressed data files include:

  1. Player settings - globalgamemanagers and globalgamemanagers.assets files.
  2. Scenes and Assets - level* and sharedassets*.asset files.
  3. Resources - resources.assets files.
  4. GI data.
  5. Built-in resources - unity_builtin_extra file.

CompressWithLz4 sets compression parameters to LZ4 compression and splits data files into 128KB chunks.
This feature is supported for Standalone, Android and iOS build targets and is default for WebGL target.
Enabling CompressWithLz4 in Android might be a significant performance boost when loading data as LZ4 decompression is faster than the default Zip decompression.

Note:
Compression might affect the size of a game installer making it larger, even though size of the Player on a device is smaller. Subsequent compression is less efficient or even impossible.

See Also: BuildAssetBundleOptions.ChunkBasedCompression, AssetBundles-Building, ReducingFilesize.