Setup for All Unity Tango Apps

In this tutorial, you'll learn the basic setup operations that are required for most Tango apps you'll create in Unity. The tutorials for Tango features such as motion tracking and augmented reality all use this setup as a starting point.

Create a new project in Unity

  1. Select File > New Project. This opens the Projects window.
  2. In the Project name text box, enter a name for your new project.
  3. Accept the default location for your project displayed in the Location text box, or click the icon in the right side of the box and then navigate to a different location.
  4. Make sure that the project is set to 3D.
  5. Click Create Project.

Import the Tango SDK

If you haven't already downloaded the Tango SDK .unitypackage file from our Downloads page, do so now.

  1. Select Assets > Import Package > Custom Package.
  2. Navigate to the TangoSDK .unitypackage file that you downloaded, and then open it.
  3. In the Import Unity Package dialog, make sure all the boxes are checked (they should be by default), and then click Import at the bottom right.

    The Tango assets are displayed in the Assets folder of the Project panel.

Delete the main camera

In the Hierarchy panel, select and then delete the Main Camera gameObject.

All of our Tango Unity How-To guides and most of the apps you'll create use some type of custom "prefab" camera that is found in the Tango SDK. However, for certain apps, the Main Camera may be useful (for example, a puzzle/stealth game where you see your movement in the third person). If you're planning such an app, keep the Main Camera in your project.

Add the Tango Manager

Select the All Prefabs folder to view its contents, and then drag the Tango Manager prefab into the Hierarchy view.

Set the build settings

You only need to set the build settings once per project; after that, when you need to create a new build, you can just open the File menu and then click Build and Run.

  1. Select File > Build Settings.
  2. In the Platform list, select Android, and then click the Switch Platform button. Unity takes a moment to import some assets; the Assets Progress dialog keeps you updated.
  3. After the switch platform process finishes, click the Player Settings button.
  4. Click Other Settings to open that panel, and then enter your desired package name into the Bundle Identifier field. In this example we use com.google.tango.prefab; for more information about Android application package names, see App Manifests.
  5. Click the Minimum API Level drop-down list and then choose API Level 17 or higher.
  6. Close the Build Settings dialog.

At this point, you have completed basic setup operations. You can continue from here with one of the following tutorials:

Simple Augmented Reality in Unity

Depth Perception in Unity

Placing Virtual Objects in AR (Unity)

Enviar comentarios sobre…