docs.unity3d.com
    Show / Hide Table of Contents

    Sample | Artifacts

    You can use the Artifacts sample to manage the Unity Cloud workspaces, datasets, dataset versions and artifacts that you have access to.

    Prerequisites

    To use the Unity Cloud Storage sample, you require the following:

    • An installed Storage package
    • An installed Identity package
    • A valid Unity ID

    Note: While the Unity Cloud Storage package doesn't depend on the Unity Cloud Identity package, the Identity package is used in the sample to control the authentication flow.

    Installation

    To install the sample, follow these steps:

    1. In your Unity project, go to Window > Package Manager > Unity Cloud Storage.
    2. Expand Samples and select Import beside the Workspaces and Scenes sample.

    Screenshot of the Package Manager's Workspaces and Scenes samples

    After the import process completes, you can view the imported assets under the Assets/Samples/Unity Cloud Storage folder.

    Run the sample

    To run the sample, follow these steps:

    1. In your Unity project, go to File > Open Scene.
    2. Go to Assets/Samples/Unity Cloud Storage/<package-version>/Storage/Scenes/Storage.unity and run the scene.
    3. In the Game view, select Login if you are logged out.

    Note: If you've previously logged in, the sample automatically logs you in so you can proceed to step 5.

    1. Log into the browser window that launches with your Unity ID account.
    2. Return to the sample scene to confirm that you are logged in.
      The Workspaces section lists the workspaces that you have access to.

    Workspace Screenshot

    Workspaces

    To create a workspace

    1. From the Workspaces section, go to Options > Create.
    2. In the Name field, type the name of the new workspace.
    3. Select Confirm.

    Workspace Screenshot

    To rename a workspace

    1. Select the workspace you wish to rename.
    2. Select Options > Edit.
    3. Rename the workspace.
    4. Select Confirm.

    Workspace Screenshot

    To get access to workspace details

    1. Select the entity you wish to know more about.
    2. Select Options > Details.

    Unity Cloud displays the name, ID, organization ID, and additional metadata. Workspace Screenshot

    To delete a workspace

    1. Select the workspace you wish to delete.
    2. Select Options > Delete.

    Warning: This action is irreversible.

    Datasets

    To create a dataset

    1. Select the workspace you wish to add a file to.
    2. From the Datasets section, select Options > Create.
    3. Type a name for the new dataset.
    4. Select Confirm.

    To rename a dataset

    1. Select the dataset you wish to rename.
    2. Select Options > Edit.
    3. Edit the name of the dataset.
    4. Select Confirm.

    To get access to dataset details

    1. Select the entity you wish to know more about.
    2. Select Options > Details.

    Unity Cloud displays the dataset name and ID, the workspace name and ID, and additional metadata.

    Dataset Screenshot

    To delete a dataset

    1. Select the dataset you wish to delete.
    2. Select Options > Delete.

    Warning: This action is irreversible.

    Dataset Versions

    To create a dataset version

    1. Select the dataset you want to add a file to.
    2. From the Versions section, select Options > Create.
      From there you can decide if you want this version to be public. This information is only visible to anyone with the URL.
    3. Click Confirm.

    To get access to dataset version details

    1. Select the entity you wish to know more about.
    2. Select Options > Details.

    Unity Cloud displays the dataset version's ID, the workspace name and ID, the name of the dataset and ID, whether the version is public, and the version's commit details.

    Dataset Version Screenshot

    To delete a dataset version

    1. Select the dataset version you wish to delete.
    2. Select Options > Delete.

    Warning: This action is irreversible.

    Artifacts

    Important: This sample only supports desktop platforms, when it comes to downloading and uploading files.

    To upload files

    1. Select a new dataset version.
    2. Select Upload file.
    3. Using the prompt, select the file from your disk.
      Artifact Screenshot
      Once the file is uploaded, a prompt appears.
      Artifact Screenshot
    4. Select Commit to commit the version.
      The version number increments to the next sequential number.

    Note: No more file can be uploaded to this version.

    To get access to artifact details

    1. Select the entity you wish to know more about.
    2. Select Options > Details.

    Artifact Screenshot

    To download an artifact

    1. Select the artifact you wish to download.
    2. Select Options > Download.
    3. Select the input target path.
    4. Select Save.

    Main components

    This section describes the scripts that make up the Storage sample.

    Workspaces, datasets, versions & artifacts

    This sample contains various components (hidden under the UI folder), whose purpose is to manage a complex and advanced UI, such as WorkspacesReadOnlyBehaviour or DatasetsBehaviour.

    When using the Storage SDK, the most important classes to be familiar with are the following:

    • WorkspacesController shows how to use IWorkspaceRepository and gets a list of IWorkspace.
    • WorkspaceViewer shows how to extract information from an IWorkspace.
    • DatasetController shows how to use IWorkspace and gets a list of IDataset.
    • DatasetViewer shows how to extract information from an IDataset.
    • VersionController shows how to use IDataset and gets a list of IDatasetVersion.
    • VersionViewer shows how to extract information from an IDatasetVersion.
    • ArtifactController shows how to use IDatasetVersion and gets a list of IArtifact.
    • ArtifactViewer shows how to extract information from an IArtifact.

    Platform services script

    The PlatformServices class initializes and disposes of the IWorkspaceRepository and its dependencies. The PlatformServices class exposes the provider through a property so any component that needs to retrieve workspace information can use this provider. The PlatformServices class has two accompanying classes called PlatformServicesInitialization and PlatformServicesShutdown that call the initialization and shutdown methods through Unity's standard Monobehaviour methods Awake(), Start() and OnDestroy().

    Login manager script

    The LoginManager class is responsible for the user login. Refer to the Identity package and its samples for details about user authentication.

    Troubleshooting

    This section describes issues you might have while using the Workspaces and Scenes sample.

    I have a missing dependency error message for com.digital-twins.identity

    If you don't have the Identity package installed, you receive the following error in your console: error CS1029: #error: 'Missing dependency to com.unity.cloud.identity package.'

    Use the Package Manager to add the Identity package to your project.

    The automatic browser redirection doesn't work

    If you run the sample in the Unity Editor, you should see the following page after you successfully login through your browser.

    Screenshot of a successful login

    If you aren't automatically redirected to the Editor and nothing happens when you select Launch Application, return to the Editor. This should continue the authentication process.

    The mouse input isn't registered

    This sample isn't created to run with the Input System package. If you're using this package in your project, your mouse selections may not be detected.

    To fix this, set your project to support both the built-in input system and the Input System package: go to Edit > Project Settings > Player and set Active Input Handling to Both.

    Screenshot of the Active Input Handling field

    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