Installing Unity and ARCore

Installing the Unity editor is relatively straightforward. However, the version of Unity we will be using may still be in beta. Therefore, it is important that you pay special attention to the following instructions when installing Unity:

  1. Navigate a web browser to https://unity3d.com/unity/beta.
At the time of writing, we will use the most recent beta version of Unity since ARCore is also still in beta preview. Be sure to note the version you are downloading and installing. This will help in the event you have issues working with ARCore. 
  1. Click on the Download installer button. This will download UnityDownloadAssistant.
  2. Launch UnityDownloadAssistant.
  3. Click on Next and then agree to the Terms of Service. Click on Next again.
  4. Select the components, as shown:
Selecting the components to install
  1. Install Unity in a folder that identifies the version, as follows:
Setting the Unity installation path
  1. Click on Next to download and install Unity. This can take a while, so get up, move around, and grab a beverage.
  2. Click on the Finish button and ensure that Unity is set to launch automatically. Let Unity launch and leave the window open. We will get back to it shortly.

Once Unity is installed, we want to download the ARCore SDK for Unity. This will be easy now that we have Git installed. Follow the given instructions to install the SDK:

  1. Open a shell or Command Prompt.
  2. Navigate to your Android folder. On Windows, use this:
cd C:Android
  1. Type and execute the following:
git clone https://github.com/google-ar/arcore-unity-sdk.git
  1. After the git command completes, you will see a new folder called arcore-unity-sdk.
If this is your first time using Unity, you will need to go online to https://unity3d.com/ and create a Unity user account. The Unity editor will require that you log in on first use and from time to time.

Now that we have Unity and ARCore installed, it's time to open the sample project by implementing the following steps:

  1. If you closed the Unity window, launch the Unity editor. The path on Windows will be C:Unity 2017.3.0b8EditorUnity.exe. Feel free to create a shortcut with the version number in order to make it easier to launch the specific Unity version later.
  2. Switch to the Unity project window and click on the Open button.
  3. Select the Android/arcore-unity-sdk folder. This is the folder we used the git command to install the SDK to earlier, as shown in the following dialog:
Opening the sample ARCore Unity project
  1. Click on the Select Folder button. This will launch the editor and load the project.
  2. Open the Assets/GoogleARCore/HelloARExample/Scenes folder in the Project window, as shown in the following excerpt:
Opening the scenes folder
  1. Double-click on the HelloAR scene, as shown in the Project window and in the preceding screenshot. This will load our AR scene into Unity.
At any point, if you see red console or error messages in the bottom status bar, this likely means you have a version conflict. You will likely need to install a different version of Unity. Consult Chapter 11, Performance Tips and Troubleshooting for more help.

Now that we have Unity and ARCore installed, we will build the project and deploy the app to an Android device in the next section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.227.114.125