private static IObservable <AssetBundle> LoadSingleManifest(IURLResolver urlResolverSingleManifest) { Func <IObservable <AssetBundle> > createStream = () => AssetBundle.LoadFromFileAsync(CreateLocalSingleManifestPath()).AsAsyncOperationObservable().Select(assetBundleCreateRequest => assetBundleCreateRequest.assetBundle); if (!HasSingleManifest()) { return(ObservableUnityWebRequest .GetData(urlResolverSingleManifest.Resolve()) .Timeout(TimeSpan.FromSeconds(TIMEOUT_SECONDS)) .Retry(RETRY_COUNT) .Do(SaveSingleManifest) .SelectMany(_ => createStream())); } return(createStream()); }
private static IObservable <AssetBundle> LoadSingleManifest(IURLResolver urlResolverSingleManifest) { Func <IObservable <AssetBundle> > createStream = () => AssetBundle.LoadFromFileAsync(CreateLocalSingleManifestPath()).AsAsyncOperationObservable().Select(assetBundleCreateRequest => assetBundleCreateRequest.assetBundle); if (!HasSingleManifest()) { return(ObservableUnityWebRequest .GetData(urlResolverSingleManifest.ResolveSingleManifest(ContextManager.CurrentProject.Name).ToString()) .Timeout(TimeSpan.FromSeconds(TimeoutSeconds)) .Retry(RetryCount) .Do(SaveSingleManifest) .SelectMany(_ => createStream())); } return(createStream()); }