docs.unity.cn
    Show / Hide Table of Contents

    Class ContentDownloadService

    Class responsible for managing active content downloads.

    Inheritance
    Object
    ContentDownloadService
    Namespace: Unity.Entities.Content
    Syntax
    public class ContentDownloadService : IDisposable

    Constructors

    Name Description
    ContentDownloadService(String, String, Int32, Int32, Func<ContentDownloadService.DownloadOperation>)

    Construct a download service.

    Properties

    Name Description
    CacheRoot

    The root directory of the local cache.

    Name

    The download service name. Each service name must be unique.

    Priority

    The priority of the service. Higher values will place it at the front of the service list.

    TotalBytes

    Total bytes processed.

    TotalDownloadedBytes

    Total bytes downloaded.

    Methods

    Name Description
    CancelDownload(RemoteContentLocation)

    Called when a download needs to be cancelled. This is not guaranteed to cancel the operation.

    CanDownload(RemoteContentLocation)

    Used to determine which download service to use to download content. Each service is checked in order until a servce returns true.

    ClearDownloadProgress()

    Resets the download statistics.

    ComputeCachePath(RemoteContentLocation)

    Computes the local path of the content in the cache.

    Dispose()

    Release up internal resources

    DownloadContent(in RemoteContentLocation)

    Starts the process of downloading content.

    GetDownloadProgress(RemoteContentLocation, ref Int64, ref Int64)

    Gets the downlaod progress for a specific location.

    GetDownloadStatus(in RemoteContentLocation)

    Gets the download status for a specific location. If the content is cached, this will return a completed status even if the content was not explicitly requested.

    GetLocalCacheFilePath(RemoteContentLocation, out String)

    Gets the local cache file path for a location and checks to see if it exists.

    OnAddedToDeliveryService(ContentDeliveryService)

    Called when added to the content delivery service.

    Process()

    Processes active downloads and updates status.

    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, September 20, 2023