Augmented Reality for Developers
上QQ阅读APP看书,第一时间看更新

Importing the ARToolkit Assets package

Now that the ARToolkit package is downloaded we can import it into our Unity project. In Unity, do the following:

  1. Go to the Main Menu
  2. Click on Assets | Import Package | Custom Package..., find your ARToolkit Unity package file
  3. Import the files into your project.

These steps may be very familiar since they're common any time you import a third-party package into Unity and were detailed previously for Vuforia (please refer to the previous instructions, if you wish).

Some versions of the ARToolkit Unity package for macOS, including 5.3.2, erroneously include Unity system files that should not be imported. In the Import Unity Package dialog, be sure to tick the checkboxes of only ARToolKit5-Unity, Plugins, and StreamingAssets, and not any other Unity folders, as shown here.

The ARToolkit package is now imported into your Unity project. Look at the Project panel. You will see several new folders, including ARToolkit5-Unity, Plugins, and StreamingAssets:

The Plugins folder is where Unity keeps platform-specific binary and API code files. It now contains ARToolkit's low-level API libraries and related files for Windows, iOS, Android, and other supported platforms.

Note the ARWrapper bundle folder in Plugins. It is an intermediary layer of code between the Unity SDK and lower-level API, an important feature of the ARToolkit device-independent architecture. We will learn to deal with this in Visual Studio in the next chapter.

The StreamingAssets folder is where Unity expects to find media files that may be used by the app at runtime. For ARToolkit, this is where you'll copy target data you've prepared for your application. It now contains some example files used by the example scenes.

The ARToolkit5 folder contains many Unity assets that may be useful in your project, including Materials, Scripts, Shaders, and Examples. We'll explore these further in our projects.