public override AssetRequest <TAsset> LoadAsync <TAsset>(string deviceList, ref ContentManifest.AssetEntry entry, AssetLoadedHandler <TAsset> handler = null) { StreamingAssetBundleWrapper streamingAssetBundleWrapper = new StreamingAssetBundleWrapper(); AsyncStreamingAssetBundleRequest <TAsset> result = new AsyncStreamingAssetBundleRequest <TAsset>(entry.Key, streamingAssetBundleWrapper); CoroutineRunner.StartPersistent(loadBundleFromStreamingAssets(entry, streamingAssetBundleWrapper, handler), this, "loadBundleFromStreamingAssets"); return(result); }
private IEnumerator loadBundleFromStreamingAssets <TAsset>(ContentManifest.AssetEntry entry, StreamingAssetBundleWrapper wrapper, AssetLoadedHandler <TAsset> handler) where TAsset : class { string key = entry.Key; wrapper.LoadFromDownload(Path.Combine(streamingAssetsPath, entry.Key + ".txt")); yield return(wrapper.WebRequest); AssetBundle assetBundle = wrapper.AssetBundle; handler?.Invoke(key, (TAsset)(object)assetBundle); yield return(null); }