Code implementation details

Obviously, the most important part of any project is actually to implement what we want to accomplish. We want this project to play a literary quote from a list of audio samples automatically. To do this, we need an audio source and audio clips. We also want this project to take advantage of ARKit to run, so we need to write a C# class that utilizes features from the ARKit plugin that is exposed from the Objective-C and C++ libraries.

Let’s open up the ARHitCube class, fill in the details, and explain what is happening at the same time. I should note that very similar code is already provided in the script file called UnityARHitTestExample; I created this script to be able to show only what is needed and to be ...

Get Unity 2018 Augmented Reality Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.