docs.unity3d.com
    Show / Hide Table of Contents

    Use case | Manage dataset versions

    This use case outlines how to set up your project to access and manage dataset versions.

    Prerequisites

    To accomplish this use case, do the following:

    1. Set up a Unity scene, create CloudWorkspaceRepository and StorageBehaviour as described in Use case | Manage workspaces.
    2. Create DatasetExamples to access datasets as described in Use case | Manage datasets.

    Manage Versions

    Create VersionExamples script

    1. In your Unity project window, go to Assets > Scripts.
    2. Right-click the Assets/Scripts folder.
    3. Select Create > C# Script.
    4. Name your script VersionExamples.
    5. Update the VersionExamples class to look like the following:

    Add "Create version" example

    To add Create version example, add following code to your VersionExamples class:

    Add "List versions" example

    To add List versions example, add following code to your VersionExamples class:

    Add "Delete version" example

    To add Delete version example, add following code to your VersionExamples class:

    Add "Version metadata" example

    To add Version metadata example, add following code to your VersionExamples class:

    Manage Artifacts

    Add "Upload file" example

    1. To add Upload file example, add following code to your VersionExamples class:
    2. Paste the path to the file you want to upload into the string named k_FilePath. Make sure the file exists.

    Add "Download file" example

    1. To add Download file example, add following code to your VersionExamples class:
    2. Paste the path to a folder on disk into the string named k_TargetFolderPath. This folder will be used to download files to. Make sure the folder exists.

    Run examples

    1. Replace RunVersionsExamples() method in your VersionExamples class with following code:
    2. Replace RunExamples() method in your StorageBehaviour class with following code:
    3. In Unity Editor, select Play.
    4. Check your console to confirm that you have successfully created, listed, and deleted datasets as well as added, changed, and deleted metadata:
      Screenshot of the console after the versions examples run
    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