Table of Contents

Class URIAvDataLoader

Loads avatar data from remote URIs via UnityWebRequest.Get(Uri). Downloads are performed in parallel.

public class URIAvDataLoader : IAvDataLoader
Inheritance
object
URIAvDataLoader
Implements

Constructors

URIAvDataLoader(string, string, AvModelFileExtension, string?, string?, Encoding?)

Creates a loader configured to download avatar data from explicit URIs.

public URIAvDataLoader(string modelURI, string metadataURI, AvModelFileExtension modelFormat, string? fullRenderURI = null, string? bustRenderURI = null, Encoding? metadataEncoding = null)

Parameters

modelURI string

Direct URI to the avatar model file.

metadataURI string

Direct URI to the metadata JSON file.

modelFormat AvModelFileExtension

The file format/extension of the model. Must be explicitly specified (no auto-detection like with FileAvDataLoader).

fullRenderURI string

Optional URI to the full-body render image.

bustRenderURI string

Optional URI to the bust/half-body render image.

metadataEncoding Encoding

Text encoding for the metadata JSON. Defaults to UTF-8.

Exceptions

ArgumentException

Thrown if modelFormat is None, as URI-based loading requires an explicit format.

URIAvDataLoader(Uri, Uri, AvModelFileExtension, Uri?, Uri?, Encoding?)

Creates a loader configured to download avatar data from explicit URIs.

public URIAvDataLoader(Uri modelURI, Uri metadataURI, AvModelFileExtension modelFormat, Uri? fullRenderURI = null, Uri? bustRenderURI = null, Encoding? metadataEncoding = null)

Parameters

modelURI Uri

Direct URI to the avatar model file.

metadataURI Uri

Direct URI to the metadata JSON file.

modelFormat AvModelFileExtension

The file format/extension of the model. Must be explicitly specified (no auto-detection like with FileAvDataLoader).

fullRenderURI Uri

Optional URI to the full-body render image.

bustRenderURI Uri

Optional URI to the bust/half-body render image.

metadataEncoding Encoding

Text encoding for the metadata JSON. Defaults to UTF-8.

Exceptions

ArgumentException

Thrown if modelFormat is None, as URI-based loading requires an explicit format.

Fields

WebRequestConfigurationCallback

Called each time a new UnityWebRequest is created, e.g. for auth configuration.

public Func<UnityWebRequest, Awaitable>? WebRequestConfigurationCallback

Field Value

Func<UnityWebRequest, Awaitable>

Methods

LoadAvatarAsync(bool, CancellationToken)

Tries loading an avatar into an AvSourceData.

public Awaitable<AvSourceData?> LoadAvatarAsync(bool throwOnFail, CancellationToken token = default)

Parameters

throwOnFail bool

Should this method throw errors on failures or log them as warnings and return null?

token CancellationToken

Returns

Awaitable<AvSourceData>

The loaded data if successful; null on failure.