Class AwaitableDownload
Default IDownload implementation that loads URIs via UnityWebRequest
Inherited Members
Namespace: GLTFast.Loading
Assembly: glTFast.dll
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[] |
Error
If the download failed, error description
Declaration
public string Error { get; }
Property Value
Type | Description |
---|---|
string |
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 |
---|---|
bool? |
Success
True if the download finished and was successful
Declaration
public bool Success { get; }
Property Value
Type | Description |
---|---|
bool |
Text
Downloaded data as string
Declaration
public string Text { get; }
Property Value
Type | Description |
---|---|
string |
Methods
Dispose()
Releases previously allocated resources.
Declaration
public void Dispose()
WaitAsync()
Waits until the URI request is completed.
Declaration
public Task WaitAsync()
Returns
Type | Description |
---|---|
Task | A task that represents the completion of the download |