com.deucarian.object-loading.api-integration
v0.1.2-dev.2
Published
Optional integration that lets Deucarian Object Loading download AssetBundle bytes through Deucarian API.
Downloads
102
Maintainers
Readme
Deucarian Object Loading API Integration
Overview
com.deucarian.object-loading.api-integration is an optional UPM package that adapts API to Deucarian Object Loading.
The core com.deucarian.object-loading package has no API dependency. Use this integration only when downloads should go through API request handling.
Migration note: replace old manifest entries for com.deucarian.object-loading.api-bridge with com.deucarian.object-loading.api-integration. The source repository URL still uses Object-Loading-API-Bridge.git until the GitHub repository is renamed.
What It Does
- Implements
IObjectDownloaderasApiObjectDownloader. - Converts
ObjectLoadRequestURL, headers, bearer token, timeout, and cancellation into an APIApiRequest. - Requests
ApiResponseFormat.Bytes. - Maps
ApiResult<byte[]>back toObjectDownloadResult. - Maps API errors to
ObjectLoadError. - Keeps auth token passing explicit through
ObjectLoadRequest.BearerToken,Authorization: Bearer ..., or an explicitly composed API client.
What It Does Not Do
- No Session dependency.
- No backend URL resolving.
- No backend DTOs.
- No glTF loading.
- No Addressables integration.
- No caching policy.
- No material remapping.
Backend URL resolving remains outside this integration. Resolve the final URL elsewhere, then pass it into ObjectLoadRequest.
Installation
Install this integration after installing its dependencies:
com.deucarian.object-loadingcom.deucarian.api
The package depends on com.deucarian.object-loading 1.1.1, com.deucarian.api 1.0.2, and Unity's Newtonsoft Json package 3.2.2.
Usage
using Deucarian.ObjectLoading;
using Deucarian.ObjectLoading.APIIntegration;
ObjectLoadingPipeline pipeline = new ObjectLoadingPipeline(
new DirectUrlSourceResolver(),
new ApiObjectDownloader(),
new AssetBundleContentLoader(),
new AssetBundleObjectInstantiator(),
new DefaultObjectDiagnostics());
ObjectLoadRequest request = ObjectLoadRequest.FromUrl(assetBundleUrl);
request.BearerToken = accessToken;
request.AddHeader("X-Custom-Header", "value");For explicit composition and tests, pass your own API client:
ApiObjectDownloader downloader = new ApiObjectDownloader(apiClient);Auth And Headers
ObjectLoadRequest.BearerToken becomes ApiRequest.BearerTokenOverride.
An explicit Authorization: Bearer ... header is also parsed into BearerTokenOverride. Other headers are forwarded unchanged.
ApiObjectDownloadMapper.CreateDebugSnapshotJson(...) redacts bearer tokens and sensitive headers.
Samples
Import the API Downloader Sample from Unity's Package Manager to see ApiObjectDownloader composed into an ObjectLoadingPipeline.
Tests
Run the package's EditMode tests in Unity. Tests cover auth/header forwarding, byte-result mapping, error mapping, and debug redaction.
License
See LICENSE.md.
