docs.unity3d.com
    Show / Hide Table of Contents

    Interface IAssetFileManager

    An interface that provides all the methods to interact with an IAssetFile.

    Namespace: Unity.Cloud.Assets
    Syntax
    public interface IAssetFileManager

    Methods

    CreateAssetFileAsync(IProject, IAsset, IAssetFileCreation, CancellationToken)

    Implement this method to create an asset file.

    Declaration
    Task<IAssetFile> CreateAssetFileAsync(IProject project, IAsset asset, IAssetFileCreation assetFileCreation, CancellationToken token)
    Parameters
    Type Name Description
    IProject project

    The project in which the asset resides.

    IAsset asset

    The asset the file will linked to.

    IAssetFileCreation assetFileCreation

    The object containing the information necessary to create an asset file.

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task<IAssetFile>

    A task with no result.

    Examples
    async Task CreateAssetFileAsync(IProject project, IAsset asset, IAssetFileCreation assetFileCreation, CancellationToken token)
    {
        await m_AssetFileManager.CreateAssetFileAsync(project, asset, assetFileCreation, token);
    }

    DeleteAssetFileAsync(IProject, IAssetFile, CancellationToken)

    Implement this method to delete an asset file.

    Declaration
    Task DeleteAssetFileAsync(IProject project, IAssetFile assetFile, CancellationToken token)
    Parameters
    Type Name Description
    IProject project

    The project in which the asset resides.

    IAssetFile assetFile

    The asset file

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task

    A task with no result.

    Examples
    async Task DeleteAssetFileAsync(IProject project, IAssetFile assetFile, CancellationToken token)
    {
        await m_AssetFileManager.DeleteAssetFileAsync(project, assetFile, token);
    }

    DownloadAssetFileAsync(IProject, IAssetFile, Stream, IProgress<HttpProgress>, CancellationToken)

    Implement this method to download an asset file.

    Declaration
    Task DownloadAssetFileAsync(IProject project, IAssetFile assetFile, Stream destinationStream, IProgress<HttpProgress> progress, CancellationToken token)
    Parameters
    Type Name Description
    IProject project

    The project in which the asset resides.

    IAssetFile assetFile

    The asset file

    Stream destinationStream

    The destination stream for the file content

    IProgress<HttpProgress> progress

    The progress provider.

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task

    A task.

    Examples
    async Task DownloadAssetFileAsync(IProject project, IAssetFile assetFile, Stream stream, IProgress<HttpProgress> progress, CancellationToken token)
    {
        await m_AssetFileManager.DownloadAssetFileAsync(project, assetFile, stream, progress, token);
    }

    FinalizeAssetFileUploadAsync(IProject, IAssetFile, CancellationToken)

    Implement this method to finalize the upload of an asset file.

    Declaration
    Task FinalizeAssetFileUploadAsync(IProject project, IAssetFile assetFile, CancellationToken token)
    Parameters
    Type Name Description
    IProject project

    The project in which the asset resides.

    IAssetFile assetFile

    The asset file

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task

    A task with no result.

    Examples
    async Task FinalizeAssetFileUploadAsync(IProject project, IAssetFile assetFile, CancellationToken token)
    {
        await m_AssetFileManager.FinalizeAssetFileUploadAsync(project, assetFile, token);
    }

    GetAssetFileUrlAsync(IProject, IAssetFile, AssetFileUrlType, CancellationToken)

    Implement this method to get an asset file url.

    Declaration
    Task<string> GetAssetFileUrlAsync(IProject project, IAssetFile assetFile, AssetFileUrlType urlType, CancellationToken token)
    Parameters
    Type Name Description
    IProject project

    The project in which the asset resides.

    IAssetFile assetFile

    The asset file

    AssetFileUrlType urlType

    The asset file's url type

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task<String>

    A task with no result.

    Examples
    async Task<string> GetAssetFileUrlAsync(IProject project, IAssetFile assetFile, AssetFileUrlType urlType, CancellationToken token)
    {
        return await m_AssetFileManager.GetAssetFileUrlAsync(project, assetFile, urlType, token);
    }

    UpdateAssetFileAsync(IProject, IAssetFile, CancellationToken)

    Implement this method to update an asset file.

    Declaration
    Task UpdateAssetFileAsync(IProject project, IAssetFile assetFile, CancellationToken token)
    Parameters
    Type Name Description
    IProject project

    The project in which the asset resides.

    IAssetFile assetFile

    The asset file

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task

    A task with no result.

    Examples
    async Task UpdateAssetFileAsync(IProject project, IAssetFile assetFile, CancellationToken token)
    {
        await m_AssetFileManager.UpdateAssetFileAsync(project, assetFile, token);
    }

    UploadAssetFileAsync(IProject, IAssetFile, Stream, IProgress<HttpProgress>, CancellationToken)

    Implement this method to upload an asset file.

    Declaration
    Task<bool> UploadAssetFileAsync(IProject project, IAssetFile assetFile, Stream contentStream, IProgress<HttpProgress> progress, CancellationToken token)
    Parameters
    Type Name Description
    IProject project

    The project in which the asset resides.

    IAssetFile assetFile

    The asset file

    Stream contentStream

    The stream to the file content

    IProgress<HttpProgress> progress

    The progress provider.

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task<Boolean>

    A task whose result signals the success of the upload.

    Examples
    async Task<bool> UploadAssetFileAsync(IProject project, IAssetFile assetFile, Stream stream, IProgress<HttpProgress> progress, CancellationToken token)
    {
        return await m_AssetFileManager.UploadAssetFileAsync(project, assetFile, stream, progress, token);
    }

    UploadAssetFileAsync(IProject, IAssetFile, Stream, CancellationToken)

    Implement this method to upload an asset file.

    Declaration
    [Obsolete("Use UploadAssetFileAsync(IProject project, IAssetFile assetFile, Stream contentStream, IProgress<HttpProgress> progress, CancellationToken token) instead.")]
    Task<bool> UploadAssetFileAsync(IProject project, IAssetFile assetFile, Stream contentStream, CancellationToken token)
    Parameters
    Type Name Description
    IProject project

    The project in which the asset resides.

    IAssetFile assetFile

    The asset file

    Stream contentStream

    The stream to the file content

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task<Boolean>

    A task whose result signals the success of the upload.

    Examples
    async Task<bool> UploadAssetFileAsync(IProject project, IAssetFile assetFile, Stream stream, IProgress<HttpProgress> progress, CancellationToken token)
    {
        return await m_AssetFileManager.UploadAssetFileAsync(project, assetFile, stream, progress, token);
    }
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023