Quickstart in Unity
Set up your Unity Project

Create your Azure Spatial Anchor Resource

If you don't have an Azure subscription, create a free account before you begin.

Authentication

Follow the section linked below from the official Spatial Anchor documentation on how to create a Spatial Anchor resource (You can skip the rest of the sections of the Spatial Anchor documentation).
You'll need to create an Azure Spatial Anchor resource in order to get the Spatial Anchors account identifier and account key.

Get your ARWAY Developer Token

Register yourself at ARWAY Developer Portal. Get your unique developer token from the API section.

Authentication

Our REST API requires a developer token for authentication. You can get it by logging in to the Developer Portal with your registered email and password.
1
// Example Token
2
92bhF8nHJVVdLNupmUghnHDJY
Copied!
Get your unique Developer Token to make REST APIs calls. It is used in the header to make an API call to our servers.

Download the ARWAY SDK

There are 2 ways to download the ARWAY SDK -

Method 1: Using the UNITY_SDK Project

Step 1: Download the UNITY_SDK project from the Developer Portal Downloads section.
Download the latest SDK or Mapping app
Step 2: Extract the .zip file and add the project into Unity Hub.
Screenshot of Unity Hub
Step 3: Open the project with Unity 2020.1.17f1 or above till 2020.2 (2020.3 and above not supported).
Step 4: Make Sure to select Unity Scripting Backend as IL2CPP and Target Architecture to ARM 64.

Method 2: Importing the Unity Package

Step 1: Download the latest '.unitypackage' from the Releases page on GitHub.
ARWAY SDK Unity Package
Step 2: Import the '.unitypackage' into your Unity project.

Configure the Project Settings

Step 1: Open the Package Manager (Window -> Package Manager) and install the following components if not already installed -
  • AR Foundation >= 4.1.1 (2019.4 verified)
  • ARCore XR Plugin >= 4.1.1 (2019.4 verified)
  • ARKit XR Plugin >=4.1.1 (2019.4 verified)
  • Windows Mixed Reality >= 4.2.1
  • Unity XR management >= 3.2.16 (2019.4 verified)
  • TextMesh Pro >= 2.1.1 (2019.4 verified)
Step 2: Go to Player Settings (Edit -> Project Settings -> Player -> Other Settings)
  • Turn OFF the Auto Graphics API.
  • For iOS:
    • Set Graphics API to Metal.
    • Set Target Minimum Version to 12.0.
  • For Android:
    • Set Graphics API to OpenGLES3.
    • Set Minimum API Level to 24 (Android 7.0).
    • Disable Multithreaded Rendering
  • Turn ON Allow 'unsafe' Code.
Step 3: Setup your AR Settings for the platforms you are building for in the XR Plug-in Management (Edit -> Project Settings -> XR Plug-in Management)
Setup AR Settings in XR Plug-in Management
Step 4: Import the '*.tgz' Azure Spatial Anchors packages located in the Assets\ARWAYSDK\Azure Spatial SDK\Packages\ folder using the Unity Package Manager.
Import tarball packages

Configure the Azure account information

The next step is to configure the app to use your account information. You copied the Account Key, Account ID, and Account Domain values to a text editor earlier, in the "Create a Spatial Anchors resource" section.
On the Project pane, go to Assets\ARWAYSDK\Azure Spatial SDK\AzureSpatialAnchors.SDK\Resources
Select SpatialAnchorConfig. On the Inspector pane, enter the Account Key as the value for Spatial Anchors Account Key, the Account ID as the value for Spatial Anchors Account Id, and the Account Domain as the value for Spatial Anchors Account Domain.
Spatial Anchors Resource Config

Configure the mainTemplate.gradle file (Android only)

Step 1: Go to Edit > Project Settings > Player.
Step 2: In the Inspector Panel for Player Settings, select the Android icon.
Step 3: Under the Build section, check the Custom Main Gradle Template checkbox to generate a custom Gradle template at Assets\Plugins\Android\mainTemplate.gradle.
Step 4: Open your mainTemplate.gradle file in a text editor.
Step 5: In the dependencies section, paste the following dependencies:
1
implementation('com.squareup.okhttp3:okhttp:[3.11.0]')
2
implementation('com.microsoft.appcenter:appcenter-analytics:[1.10.0]')
Copied!
Step 6: When it's all done, your dependencies section should look something like this:
1
dependencies {
2
implementation fileTree(dir: 'libs', include: ['*.jar'])
3
implementation('com.squareup.okhttp3:okhttp:[3.11.0]')
4
implementation('com.microsoft.appcenter:appcenter-analytics:[1.10.0]')
5
**DEPS**}
Copied!

Configure Project Settings (Hololens only)

Step 1: You need Visual Studio 2019 or later with Universal Windows Platform development workload and the Windows 10 SDK (10.0.18362.0 or newer) components installed. You must also install Git for Windows and Git LFS.
Step 2: You need a HoloLens device on which developer mode enabled. Windows 10 May 2020 Update must be installed on the device. To update to the latest release on HoloLens, open the Settings app, go to Update & Security, and then select Check for updates.
Step 3: On your app, you need to enable the SpatialPerception capability. This setting is in Build Settings > Player Settings > Publishing Settings > Capabilities.
Step 4: On your app, you need to enable Virtual Reality Supported with Windows Mixed Reality SDK. This setting is in Build Settings > Player Settings > XR Settings.

GLTFUtility conflict fixes

WSA.zip
183KB
Binary
WSA File for hololens
  • Add this “WSA” directory in “GLTFUtility/Assemblies/
  • If building for “Hololens”, uncheck “WSAPlayer” for “AOT/Newtonsoft.Json” < This option can only be seen in Windows/Hololens platform >
  • AOT/Newtonsoft.Json is mainly for mobile/WebGL build but doesn’t work with hololens.
  • Due to conflict, we need to uncheck the WSAPlayer option
Last modified 1mo ago