docs.unity3d.com
    Show / Hide Table of Contents

    Class CloudAssetCollectionManager

    A class that provides the methods to interact with an IAssetCollection.

    Inheritance
    Object
    CloudAssetCollectionManager
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Cloud.Assets
    Syntax
    public class CloudAssetCollectionManager : IAssetCollectionManager

    Constructors

    CloudAssetCollectionManager(IServiceHttpClient, IServiceHostResolver)

    Initializes and returns an instance of CloudAssetCollectionManager

    Declaration
    public CloudAssetCollectionManager(IServiceHttpClient serviceHttpClient, IServiceHostResolver serviceHostResolver)
    Parameters
    Type Name Description
    IServiceHttpClient serviceHttpClient

    The IServiceHttpClient used to fetch the data.

    IServiceHostResolver serviceHostResolver

    The IServiceHostResolver object.

    Examples
            var httpClient = new UnityHttpClient();
            var serviceHostResolver = UnityRuntimeServiceHostResolverFactory.Create();
            var playerSettings = UnityCloudPlayerSettings.Instance;
            var platformSupport = PlatformSupportFactory.GetAuthenticationPlatformSupport();
    
            var compositeAuthenticatorSettings = new CompositeAuthenticatorSettingsBuilder(httpClient, platformSupport, serviceHostResolver)
                .AddDefaultPkceAuthenticator(playerSettings)
                .Build();
    
            var authenticator = new CompositeAuthenticator(compositeAuthenticatorSettings);
    
            var serviceHttpClient = new ServiceHttpClient(httpClient, authenticator, playerSettings);
    
            m_AssetCollectionManager = new CloudAssetCollectionManager(serviceHttpClient, serviceHostResolver);

    Methods

    CreateCollectionAsync(IProject, IAssetCollection, CancellationToken)

    Creates a new IAssetCollection at the specified path. in an IProject.

    Declaration
    public Task<CollectionPath> CreateCollectionAsync(IProject project, IAssetCollection assetCollection, CancellationToken token)
    Parameters
    Type Name Description
    IProject project

    The project in which the collection will reside.

    IAssetCollection assetCollection

    The collection to commit to the cloud.

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task<CollectionPath>

    A task whose result is the path to the new collection within the project.

    Implements
    IAssetCollectionManager.CreateCollectionAsync(IProject, IAssetCollection, CancellationToken)
    Exceptions
    Type Condition
    ArgumentNullException

    This exception is thrown if the IAssetCollection has invalid members.

    DeleteCollectionAsync(IAssetCollection, CancellationToken)

    Deletes the IAssetCollection at the specified path from an IProject.

    Declaration
    public Task DeleteCollectionAsync(IAssetCollection assetCollection, CancellationToken token)
    Parameters
    Type Name Description
    IAssetCollection assetCollection

    The collection to remove from the cloud.

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task

    A task with no result.

    Implements
    IAssetCollectionManager.DeleteCollectionAsync(IAssetCollection, CancellationToken)

    GetCollectionAsync(IProject, CollectionPath, CancellationToken)

    Gets an IAssetCollection in an IProject.

    Declaration
    public Task<IAssetCollection> GetCollectionAsync(IProject project, CollectionPath collectionPath, CancellationToken token)
    Parameters
    Type Name Description
    IProject project

    The project in which the collection resides.

    CollectionPath collectionPath

    The path to a collection.

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task<IAssetCollection>

    A task whose result is the IAssetCollection at path collectionPath.

    Implements
    IAssetCollectionManager.GetCollectionAsync(IProject, CollectionPath, CancellationToken)

    InsertAssetsToCollectionAsync(IProject, CollectionPath, IEnumerable<IAsset>, CancellationToken)

    Implement this method to insert assets into a collection in an IProject.

    Declaration
    public Task InsertAssetsToCollectionAsync(IProject project, CollectionPath collectionPath, IEnumerable<IAsset> assets, CancellationToken token)
    Parameters
    Type Name Description
    IProject project

    The project the collection belongs to.

    CollectionPath collectionPath

    The path to the collection to be modified.

    IEnumerable<IAsset> assets

    The assets to add.

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task

    A task with no result.

    Implements
    IAssetCollectionManager.InsertAssetsToCollectionAsync(IProject, CollectionPath, IEnumerable<IAsset>, CancellationToken)

    ListCollectionsAsync(IProject, CancellationToken)

    Gets the collections in an IProject.

    Declaration
    public Task<IAssetCollection[]> ListCollectionsAsync(IProject project, CancellationToken token)
    Parameters
    Type Name Description
    IProject project

    The project in which the collections reside.

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task<IAssetCollection[]>

    A task whose result is an array of collections.

    Implements
    IAssetCollectionManager.ListCollectionsAsync(IProject, CancellationToken)

    MoveCollectionToNewPathAsync(IAssetCollection, CollectionPath, CancellationToken)

    Implement this method to move a collection in an IProject to a new path.

    Declaration
    public Task<string> MoveCollectionToNewPathAsync(IAssetCollection assetCollection, CollectionPath newCollectionPath, CancellationToken token)
    Parameters
    Type Name Description
    IAssetCollection assetCollection
    CollectionPath newCollectionPath
    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task<String>

    A task whose result is the new path to the collection.

    Implements
    IAssetCollectionManager.MoveCollectionToNewPathAsync(IAssetCollection, CollectionPath, CancellationToken)

    RemoveAssetsFromCollectionAsync(IProject, CollectionPath, IEnumerable<IAsset>, CancellationToken)

    Implement this method to remove assets from a collection in an IProject.

    Declaration
    public Task RemoveAssetsFromCollectionAsync(IProject project, CollectionPath collectionPath, IEnumerable<IAsset> assets, CancellationToken token)
    Parameters
    Type Name Description
    IProject project

    The project the collection belongs to.

    CollectionPath collectionPath

    The path to the collection to modified.

    IEnumerable<IAsset> assets

    The assets to remove.

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task

    A task with no result.

    Implements
    IAssetCollectionManager.RemoveAssetsFromCollectionAsync(IProject, CollectionPath, IEnumerable<IAsset>, CancellationToken)

    UpdateCollectionAsync(IAssetCollection, CancellationToken)

    Updates an IAssetCollection in an IProject.

    Declaration
    public Task UpdateCollectionAsync(IAssetCollection assetCollection, CancellationToken token)
    Parameters
    Type Name Description
    IAssetCollection assetCollection

    The collection to commit to the cloud.

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task

    A task with no result.

    Implements
    IAssetCollectionManager.UpdateCollectionAsync(IAssetCollection, CancellationToken)

    Extension Methods

    AssetCollectionExtensions.InsertAssetsToCollectionAsync(IAssetCollectionManager, IAssetCollection, IEnumerable<IAsset>, CancellationToken)
    AssetCollectionExtensions.RemoveAssetsFromCollectionAsync(IAssetCollectionManager, IAssetCollection, IEnumerable<IAsset>, CancellationToken)
    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