private async Task TestDownloadAllBlobsAsync() { if (!Directory.Exists(Application.streamingAssetsPath)) { Directory.CreateDirectory(Application.streamingAssetsPath); } await BlobStorageUtilities.DownloadAllBlobsInContainerAsync(blockBlobContainerName, Application.streamingAssetsPath); }
/// <summary> /// Check if the required files exist locally. If not, /// download the assets from Azure Storage. /// In a production scenario, you would want to gracefully handle /// situations where we cannot connect to the internet or /// some other issue blocks the downloading of the assets. /// </summary> private async Task DownloadRequiredFiles() { bool requiredFilesExist = CheckIfRequiredFilesExist(); if (!requiredFilesExist) { if (!Directory.Exists(DestinationPath)) { Directory.CreateDirectory(DestinationPath); } await BlobStorageUtilities.DownloadAllBlobsInContainerAsync(blockBlobContainerName, DestinationPath); } DownloadingMusicFilesFinished?.Invoke(); }