Skip to content

Commit

Permalink
com.rest.blockadelabs 1.3.0 (#15)
Browse files Browse the repository at this point in the history
- upgraded com.utilities.rest -> 2.4.0
  • Loading branch information
StephenHodgson committed Dec 14, 2023
1 parent fe07e72 commit f53da9f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public async Task<SkyboxInfo> GenerateSkyboxAsync(SkyboxRequest skyboxRequest, S
skyboxInfo = await GetSkyboxInfoAsync(skyboxInfo.Id, cancellationToken);
}

await skyboxInfo.LoadAssetsAsync(cancellationToken);
await skyboxInfo.LoadAssetsAsync(EnableDebug, cancellationToken);
return skyboxInfo;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,21 +144,22 @@ public sealed class SkyboxInfo
/// <param name="cancellationToken">Optional, <see cref="CancellationToken"/>.</param>
[Obsolete("Use LoadAssetsAsync")]
public async Task LoadTexturesAsync(CancellationToken cancellationToken = default)
=> await LoadAssetsAsync(cancellationToken);
=> await LoadAssetsAsync(false, cancellationToken);

/// <summary>
/// Downloads and loads all of the assets associated with this skybox.
/// </summary>
/// <param name="debug">Optional, debug downloads.</param>
/// <param name="cancellationToken">Optional, <see cref="CancellationToken"/>.</param>
public async Task LoadAssetsAsync(CancellationToken cancellationToken = default)
public async Task LoadAssetsAsync(bool debug = false, CancellationToken cancellationToken = default)
{
async Task DownloadThumbnail()
{
if (!string.IsNullOrWhiteSpace(ThumbUrl))
{
await Awaiters.UnityMainThread;
Rest.TryGetFileNameFromUrl(ThumbUrl, out var filename);
Thumbnail = await Rest.DownloadTextureAsync(ThumbUrl, fileName: $"{ObfuscatedId}-thumb{Path.GetExtension(filename)}", cancellationToken: cancellationToken);
Thumbnail = await Rest.DownloadTextureAsync(ThumbUrl, fileName: $"{ObfuscatedId}-thumb{Path.GetExtension(filename)}", null, debug, cancellationToken);
}
}

Expand All @@ -179,18 +180,18 @@ async Task DownloadExport(KeyValuePair<string, string> export)
case "depth-map-png":
case "equirectangular-png":
case "equirectangular-jpg":
var texture = await Rest.DownloadTextureAsync(exportUrl, path, cancellationToken: cancellationToken);
var texture = await Rest.DownloadTextureAsync(exportUrl, path, null, debug, cancellationToken);
exportedAssets[export.Key] = texture;
break;
case "cube-map-default-png":
case "cube-map-roblox-png":
var zipPath = await Rest.DownloadFileAsync(exportUrl, path, cancellationToken: cancellationToken);
var zipPath = await Rest.DownloadFileAsync(exportUrl, path, null, debug, cancellationToken);
var files = await ExportUtilities.UnZipAsync(zipPath, cancellationToken);
var textures = new List<Texture2D>();

foreach (var file in files)
{
var face = await Rest.DownloadTextureAsync($"file:https://{file}", cancellationToken: cancellationToken);
var face = await Rest.DownloadTextureAsync($"file:https://{file}", null, null, debug, cancellationToken);
textures.Add(face);
}

Expand All @@ -202,7 +203,7 @@ async Task DownloadExport(KeyValuePair<string, string> export)
case "video-landscape-mp4":
case "video-portrait-mp4":
case "video-square-mp4":
await Rest.DownloadFileAsync(exportUrl, path, cancellationToken: cancellationToken);
await Rest.DownloadFileAsync(exportUrl, path, null, debug, cancellationToken);
break;
default:
Debug.LogWarning($"No download task defined for {export.Key}!");
Expand Down
4 changes: 2 additions & 2 deletions BlockadeLabs/Packages/com.rest.blockadelabs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "BlockadeLabs",
"description": "A Non-Official Blockade Labs Rest Client for Unity (UPM)",
"keywords": [],
"version": "1.2.1",
"version": "1.3.0",
"unity": "2021.3",
"documentationUrl": "https://github.com/RageAgainstThePixel/com.rest.blockadelabs#documentation",
"changelogUrl": "https://github.com/RageAgainstThePixel/com.rest.blockadelabs/releases",
Expand All @@ -17,7 +17,7 @@
"url": "https://github.com/StephenHodgson"
},
"dependencies": {
"com.utilities.rest": "2.3.1",
"com.utilities.rest": "2.4.0",
"com.unity.modules.video": "1.0.0",
"com.unity.sharp-zip-lib": "1.3.4-preview"
},
Expand Down
2 changes: 1 addition & 1 deletion BlockadeLabs/Packages/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"com.unity.ide.rider": "3.0.26",
"com.unity.ide.rider": "3.0.27",
"com.unity.ide.visualstudio": "2.0.22",
"com.unity.test-framework": "1.1.33",
"com.unity.textmeshpro": "3.0.6",
Expand Down

0 comments on commit f53da9f

Please sign in to comment.