docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Sample: Manage asset collections

    Use the Collection Management sample to list and manage the collections of assets in your projects.

    Note

    To manage assets, you need the Asset Manager Admin role at the organization level or the Asset Manager Contributor add-on role at the project level. Asset Manager Contributors can manage assets only for the specific projects to which they have access.

    Before you start

    Before you use the Collection Management sample, make sure you have the following:

    • An installed Assets package.
    • An installed Identity package.
    • A valid Unity ID Account.
    • Access to your Unity Gaming Services account.
    • A Unity Project with the Asset Manager service enabled. Read more about creating a Unity project.
    • Access to the Asset Manager service.
    • At least one published asset in an Asset Manager project. Read more about adding assets using the Asset SDK and adding a single asset or multiple assets through the dashboard.
    Note

    Although the Assets package does not depend on the Identity service, the sample uses the service to control the authentication process.

    Install the sample

    To install the sample, follow these steps:

    1. Open your application project in the Unity Editor.

    2. Go to Window > Package Manager > Unity Cloud Assets.

    3. Expand the Samples section.

    4. Next to Collection Management, select Import.

      Screenshot of the samples import section of the package manager window
    5. After the import process completes, the sample displays under the Assets/Samples/Unity Cloud Assets folder.

    Screenshot of the imported sample

    Run the sample

    To run the sample, follow these steps:

    1. Go to Assets/Samples/Unity Cloud Assets/<package-version>/Asset Collection Management/Scenes/CollectionManagementSample.unity and run the scene.

    2. Select an organization to display the list of projects in the selected organization on the left panel.

      Screenshot of the Organization selection
    3. Select a project to display the list of collections in the selected project on the middle panel.

      Screenshot of the project list
    4. Select a collection to display the list of assets in the selected collection on the right panel.

      Screenshot of the collection list

    Create a new collection

    To create a new collection, follow these steps:

    1. Next to Collections, select the ellipsis button (…).

      Screenshot of the context menu
    2. Select Create.

      Screenshot of creating collection popup
    3. Enter a name and a description for the collection.

    4. Optionally, enter a parent path.

    5. Select Create.

      Screenshot of the created collection

    Edit an existing collection

    To edit an existing collection, follow these steps:

    1. Select a collection in the list.

    2. Next to Collections, select the ellipsis button (…).

      Screenshot of the context menu
    3. Select Edit.

      Screenshot of editing collection popup
    4. Enter a new name and a new description for the collection.

    5. Select Apply.

    Delete an existing collection

    To delete an existing collection, follow these steps:

    1. Select a collection in the list.

    2. Next to Collections, select the ellipsis button (…).

      Screenshot of the context menu
    3. Select Delete.

    Add assets to a collection

    To add an asset to a collection, follow these steps:

    1. Select a collection in the list.

    2. Next to Assets in Collection, select the ellipsis button (…).

      Screenshot of the context menu
    3. Select Add.

      Screenshot of adding assets to collection popup
    4. Select all the assets you want to add to the collection.

    5. Select Add.

      Screenshot of selected assets

    Remove assets from a collection

    To remove an asset from a collection, follow these steps:

    1. Select an asset in the list.

    2. Next to Assets in Collection, select the ellipsis button (…).

      Screenshot of the context menu
    3. Select Remove.

    Main components

    This section describes the scripts that make up the main components of the Asset Collection Management sample.

    Platform services script

    The PlatformServices class handles the initialization and disposal of dependencies necessary for the IAssetRepository interface. Use this class to manage the Unity Cloud services and dependencies in your application.

    To open the platform services script, go to your Assets/Samples/Unity Cloud Assets/<package-version>/Shared/Scripts/Services/PlatformServices.cs file.

    Use the following classes with the PlatformServices class:

    • PlatformServicesInitialization
    • PlatformServicesShutdown

    These classes use the following standard Unity Monobehaviour methods to run the initialization and shutdown methods:

    • Awake()
    • Start()
    • OnDestroy()

    Project controller script

    The ProjectController class inherits the following from the OrganizationController class:

    • Sign in to your application.
    • Use your ID to grant access to the Collection Management sample.

    Read more about authentication. The ProjectController class uses the IOrganizationRepository interface of the PlatformServices class to retrieve the list of organizations you have access to. The ProjectController class uses the IAssetRepository interface of the PlatformServices class to retrieve the list of your projects for the selected organization.

    To open the project controller script, go to your Assets/Samples/Unity Cloud Assets/<package-version>/Shared/Scripts/Controllers/ProjectController.cs file.

    Asset collection management sample script

    The CollectionManagementSample shows you how to do the following:

    • Integrate the login flow with the ProjectController class.
    • Retrieve organizations and projects from the Asset Manager service.
    • Retrieve published assets from the Asset Manager service.
    • Search for assets by tag or name.

    To open the Collection Management sample script, go to your Assets/Samples/Unity Cloud Assets/<package-version>/Asset Collection Management/Scripts/CollectionManagementSample.cs file.

    Collection list, asset list, and collection asset list UI scripts

    • The CollectionListUi, AssetListUi, and CollectionAssetListUi classes list the assets, collections, and assets belonging to a collection in the sample.
    • The AssetPanelUi class bridges data between AssetListUi and CollectionAssetListUi.

    Shared UI scripts

    The UI sample includes a set of UI scripts and prefabs that Unity Cloud Assets samples use. To open shared UI scripts, go to Assets/Samples/Unity Cloud Assets/<package-version>/Shared/Scripts/Controllers.

    Troubleshooting

    In case of issues with samples, refer to troubleshooting.

    In This Article
    Back to top
    Copyright © 2025 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)