Class AwaitableDownload
Default IDownload implementation that loads URIs via UnityWebRequest
Inherited Members
Namespace: Unity.Cloud.Gltfast.Loading
Assembly: Unity.Cloud.Gltfast.dll
Syntax
[MovedFrom(true, "GLTFast.Loading", "glTFast", null)]
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
Resulting data as NativeArray (does not allocate memory).
Declaration
public NativeArray<byte>.ReadOnly Data { get; }
Property Value
| Type | Description |
|---|---|
| NativeArray<byte>.ReadOnly |
Error
If the download failed, error description
Declaration
public string Error { get; }
Property Value
| Type | Description |
|---|---|
| string |
Success
True if the download finished and was successful
Declaration
public bool Success { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
Dispose()
Releases previously allocated resources.
Declaration
public void Dispose()
Dispose(bool)
Releases previously allocated resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing | Indicates whether the method call comes from a Dispose method (its value is true) or from a finalizer (its value is false). |
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 |