Using the Content Placement Sample

This sample shows a simple way to place persistent AR content stored on the device locally.

Downloading Your Map

Log in to the Developer Portal and download your map data file.

Scene Setup

The basic setup is the same as in the Multimaps Sample. All the content placement and storage is handled by the new ContentPlacementUI prefab.

Remember to add you map data file to the AR Map.

Basic scene setup with the prefab added in

The prefab consists of the ContentStorageManager Game Object and UI buttons to add and delete AR content.

The ContentStorageManager is a really simple implementation. It supports placing one type of object, specified in the script as AR Diamond by default. It also requires a reference to the AR Space the content will be placed in. You can also specify the .json filename that will get stored on the device.

Using the Sample

Open the Build Settings in Unity and only add or select the ContentPlacementSample to be included. Build the app for your device.

When you look at the location you mapped with the app running, the device should be able to localize and find its pose in seconds.

If you didn't change any settings in the ContentStorageManager script, you can now add AR Diamond objects by clicking the Add Object button. You can reset all the objects by tapping on the Remove Objects button.

You can also move the AR Diamonds by dragging them on the screen. They have the MovableContent component attached to them.

Content Placement Sample in action.