Create a new Unity project and get it ready for MRTK development. For this, first follow the Initializing your project and first application (excluding the Build and deploy the application instructions), which includes the following steps:
- Create new Unity project and give it a suitable name
- Configure the Unity project for Windows Mixed Reality
- Import TextMesh Pro Essential Resources
- Import the Mixed Reality Toolkit
- Configure the Unity project for the Mixed Reality Toolkit
- Configure the Mixed Reality Toolkit
Then follow the How to configure the Mixed Reality Toolkit Profiles (Change Spatial Awareness Display Option) instructions to change the MRTK configuration profile for your scene to the DefaultHoloLens2ConfigurationProfile and change the display options for the spatial awareness mesh to Occlusion.
Then follow Adding inbuilt Unity packages to add the AR Foundation package required by the Azure Spatial Anchors SDK and download and import the following Unity custom packages in the order they are listed:
- AzureSpatialAnchors.unitypackage (version 2.1.1)
- MRTK.HoloLens2.Unity.Tutorials.Assets.GettingStarted.2.3.0.2.unitypackage
- MRTK.HoloLens2.Unity.Tutorials.Assets.AzureSpatialAnchors.2.3.0.0.unitypackage
In the Unity menu, select Edit > Project Settings...* to open the Player Settings window. In the Player Settings window, select Player and then Publishing Settings. In the Publishing Settings, scroll down to the Capabilities section and enable the InternetClient, Microphone, and SpatialPerception capabilities. Then, enable the InternetClientServer, PrivateNetworkClientServer, RemovableStorage, and Webcam capabilities.