Unity Setup¶
Prerequisites
You’ll need the following before you can begin:
- Unity 2019.2.5f1 (make sure to include iOS build support during installation).
- Xcode 10.3+ (if building for iOS)
- Android 7.0 (API >= 24) (if building for Android)
Note
For Android, the SDK works with ARCore. Please check this list for supported devices with ARCore.
Create a new project and import the SDK¶
- Open Unity and create a new 3D project.
- Select
Window > Package Manager
and install the following packages: - AR Foundation
- ARKit XR Plugin (for iOS)
- ARCore XR Plugin (for Android)
- Select
Install the Unity SDK¶
In your Unity Project > Packages > manifest.json, add the
ai.fritz.vision
package under dependencies:{ "dependencies": { "ai.fritz.vision": "https://github.com/fritzlabs/fritz-unity-sdk.git", } }If everything is set up correctly, you should see
Fritz Vision
installed in the Unity Package Manager and under thePackages
folder.Note
For keeping up-to-date with latest releases, you can check out the SDK release page.
To pin a version of the SDK to use (for example 1.0.0), you can specify a release tag:
{ "dependencies": { "ai.fritz.vision": "https://github.com/fritzlabs/fritz-unity-sdk.git#1.0.0", } }
iOS¶
To modify your Project Settings for iOS, go to
File > Build Settings
and open the Build Settings window. SelectiOS
and clickSwitch Platform
. After the process finishes, click onPlayer Settings
.
In the
Project Settings
window, clickPlayer
.Click on
Other Settings
to expand settings for the iOS player.Configure the following settings:
Unity iOS Player Settings¶ Setting Value Architecture ARM64 Bundle Identifier <Your Bundle ID> Camera Usage Description For AR processing ![]()
In Project Settings, click
Fritz
.![]()
If you have not done so, Sign up for a free account then create an app on Fritz that matches the Bundle ID defined in unity.
Copy the API Key from the Fritz webapp (
Project Settings > <Your App> > Show API Key
) into the iOS API Key input.Click download to download the necessary Fritz Frameworks.
Note
If you are using Xcode 10.3, set version to 4.0.1.
In the Unity
Build Settings
window, clickBuild and Run
.
Android¶
To modify your Project Settings for Android, go to
Edit > Project Settings
, click on the Player option and under “Other Settings”, click on the Android tab.
In the
Project Settings
window, clickPlayer
.Click on
Other Settings
to expand settings for the Android player.Configure the following settings:
Unity Android Player Settings¶ Setting Value Graphics API OpenGLES3 (only) Multi-threaded Rendering Unselected Package Name <Your Package Name> Minimum API Level Android 7.0 Nougat (API level 24) Target Architecture ARMv7 ![]()
In Project Settings, click
Fritz
.![]()
If you have not done so, Sign up for a free account then create an app on Fritz that matches the Bundle ID defined in unity.
Copy the API Key from the Fritz webapp (
Project Settings > <Your App> > Show API Key
) into the Android API Key input.Generate a custom build.gradle template by following these directions (“Providing a custom build.gradle template”).
Once you have the template created under
Assets > Plugins > Android > mainTemplate.gradle
, make sure to include.tflite
underaaptOptions > noCompress
.aaptOptions { noCompress = ['.unity3d', '.tflite', ...] }This will tell gradle not to compress TensorFlow Lite models included with the sdk.
In the Unity
Build Settings
window, clickBuild and Run
.