LoadFromFile will load the bundle directly from disk if the bundle is uncompressed or chunk (LZ4) compressed. This API is highly-efficient when loading uncompressed bundles from local storage. File.ReadAllBytes(path) could be replaced with any desired procedure of obtaining a byte array. However, this is not the only strategy that makes using LoadFromMemoryAsync possible. Var prefab = bundle.LoadAsset("MyObject") IEnumerator LoadFromMemoryAsync(string path)ĪssetBundleCreateRequest createRequest = AssetBundle.LoadFromMemoryAsync(File.ReadAllBytes(path)) ĪssetBundle bundle = createRequest.assetBundle Here’s one example of how to use this method: using UnityEngine LZ4 compressed bundles are loaded in their compressed state. If the bundle is LZMA compressed it will decompress the AssetBundle while it’s loading. Optionally you can also pass in a CRC value if you desire. This function takes an array of bytes that contains AssetBundle data.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |