If you don't have an Azure subscription, create a free account before you begin.
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.
Register yourself at ARWAY Developer Portal. Get your unique developer token from the API section.
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.
// Example Token92bhF8nHJVVdLNupmUghnHDJY
Get your unique Developer Token to make REST APIs calls. It is used in the header to make an API call to our servers.
There are 2 ways to download the ARWAY SDK -
Step 1: Download the UNITY_SDK project from the Developer Portal Downloads section.
Step 2: Extract the .zip file and add the project into Unity Hub.
Step 3: Open the project with Unity 2019.4.3f1 or above.
Step 1: Download the latest '.unitypackage' from the Releases page on GitHub.
Step 2: Import the '.unitypackage' into your Unity project.
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)
Step 4: Import the '*.tgz' Azure Spatial Anchors packages located in the Assets\ARWAYSDK\Azure Spatial SDK\Packages\
folder using the Unity Package Manager.
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.
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:
implementation('com.squareup.okhttp3:okhttp:[3.11.0]')implementation('com.microsoft.appcenter:appcenter-analytics:[1.10.0]')
Step 6: When it's all done, your dependencies
section should look something like this:
dependencies {implementation fileTree(dir: 'libs', include: ['*.jar'])implementation('com.squareup.okhttp3:okhttp:[3.11.0]')implementation('com.microsoft.appcenter:appcenter-analytics:[1.10.0]')**DEPS**}
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.