unity2018几种加载assetbunlde方式
AssetBundle的几种加载方式
一:load byte as bundle
UnityWebRequest webBBLoadRequest = UnityWebRequest.Get(path);
yield return webBBLoadRequest.SendWebRequest();
container.bytes = webBBLoadRequest.downloadHandler.data;
AssetBundleCreateRequest bundleCreationRequest = AssetBundle.LoadFromMemoryAsync(container.bytes);
yield return bundleCreationRequest;
container.assetBundle = bundleCreationRequest.assetBundle;
二:load byte
UnityWebRequest webBytesLoadRequest = UnityWebRequest.Get(path);
yield return webBytesLoadRequest.SendWebRequest();
container.bytes = webBytesLoadRequest.downloadHandler.data;
三:load bundle:
UnityWebRequest webBundleRequest = UnityWebRequestAssetBundle.GetAssetBundle(path);
yield return webBundleRequest.SendWebRequest();
container.assetBundle = DownloadHandlerAssetBundle.GetContent(webBundleRequest);
四:load local bundle
AssetBundleCreateRequest fileBundleRequest = AssetBundle.LoadFromFileAsync(path);
yield return fileBundleRequest;
container.assetBundle = fileBundleRequest.assetBundle;