AssetBundle.LoadFromFile data integrity limits
0 reputation · 07 May 2020, 01:49 UTC
Runtime AssetBundle Verification
Unity's AssetBundle system allows for the packaging of binary files for external distribution and runtime loading via AssetBundle.LoadFromFile. While the system manages the serialization of assets, the API does not provide a native mechanism to verify the integrity of the binary file before it is loaded into memory.
When loading bundles from external storage, there is a risk of binary corruption. If the underlying file is modified or truncated, the behavior during the load process is undefined and may lead to runtime exceptions or failed asset instantiation.
Does AssetBundle.LoadFromFile perform any internal checksum validation to detect file corruption? If not, what is the recommended approach for verifying the integrity of a bundle before calling LoadAsset?