Sample: Metadata Hierarchy
The sample available as part of the Unity Cloud Data-Streaming demonstrates how to navigate through the MetadataInstance
structure.
The intended audience for this sample are developers who will want to enable users to explore the hierarchy of a streamed BIM, CAD or 3D model. This can be useful on its own, but it can be combined with raycasting and filtering functionalities, to display where a raycasted node may reside in the hierarchy, display metadata originating from parents, filter based off of a node's position in the hierarchy or filter based off of metadata in related instances.
Before you start
To use the Metadata Hierarchy sample, you need the following:
- Installed Data Streaming package and its dependencies
- Installed Identity package
- Installed Assets package
- A valid Unity ID
- At least one Unity Cloud streamable asset associated to your Unity ID
Install the sample
To install the sample, follow these steps:
In your Unity Project, go to Window > Package Manager > Unity Cloud Data Streaming.
Expand the Samples section.
On the right of the Metadata Hierarchy sample, select Import.
After the import process completes, you can view the imported assets under the
Assets/Samples/Unity Cloud Data Streaming
folder.
Run the sample
To run the sample, follow these steps:
In your Unity Editor Project, go to File > Open Scene.
Go to
Assets/Samples/Unity Cloud Data Streaming/<package-version>/Metadata Hierarchy Sample Scene/Scenes/MetadataHierarchy.unity
and run the scene.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 6.
Log into the browser window that launches with your Unity ID account.
Return to the sample scene to confirm that you are logged in. The Organization field lists the organizations associated with your account.
From the Organization field, select an organization.
From the Project field, select a project.
From the Asset field, select an asset.
Select Launch to download and view the associated dataset. You can now navigate the metadata attached to the dataset.
Navigation
You can navigate through the MetadataInstance
structure by expanding the nodes in the left panel. To expand a node, click the arrow next to the node name. To collapse a node, click the arrow again.
Properties
You can view the properties of the instances by selecting them in the left panel. The right panel will get updated based on the selection. The properties include the instance name, ID, if it is a leaf node or if it has children, a path based on the ancestors names and the metadata fields.