docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class AwaitableDownload

    Default IDownload implementation that loads URIs via UnityWebRequest

    Inheritance
    object
    AwaitableDownload
    AwaitableTextureDownload
    CustomHeaderDownload
    Implements
    IDownload
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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

    Implements

    IDownload
    IDisposable
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)