Class AwaitableDownload
Default IDownload implementation that loads URIs via UnityWebRequest
Inherited Members
Namespace: GLTFast.Loading
Syntax
public class AwaitableDownload : IDownload, IDisposable
Constructors
AwaitableDownload()
Empty constructor
Declaration
protected AwaitableDownload()
AwaitableDownload(Uri)
Creates a download of a URI
Declaration
public AwaitableDownload(Uri url)
Parameters
Type | Name | Description |
---|---|---|
Uri | url | URI to request |
Fields
m_AsyncOperation
The download's UnityWebRequestAsyncOperation
Declaration
protected UnityWebRequestAsyncOperation m_AsyncOperation
Field Value
Type | Description |
---|---|
UnityWebRequestAsyncOperation |
m_Request
UnityWebRequest that is used for the download
Declaration
protected UnityWebRequest m_Request
Field Value
Type | Description |
---|---|
UnityWebRequest |
Properties
Data
Downloaded data as byte array
Declaration
public byte[] Data { get; }
Property Value
Type | Description |
---|---|
Byte[] |
Implements
Error
If the download failed, error description
Declaration
public string Error { get; }
Property Value
Type | Description |
---|---|
String |
Implements
IsBinary
True if the requested download is a glTF-Binary file. False if it is a regular JSON-based glTF file. Null if the type could not be determined.
Declaration
public bool? IsBinary { get; }
Property Value
Type | Description |
---|---|
Nullable<Boolean> |
Implements
Success
True if the download finished and was successful
Declaration
public bool Success { get; }
Property Value
Type | Description |
---|---|
Boolean |
Implements
Text
Downloaded data as string
Declaration
public string Text { get; }
Property Value
Type | Description |
---|---|
String |
Implements
Methods
Dispose()
Releases previously allocated resources.
Declaration
public void Dispose()
Implements
WaitAsync()
Waits until the URI request is completed.
Declaration
public async Task WaitAsync()
Returns
Type | Description |
---|---|
Task | A task that represents the completion of the download |