This is the Unity based HoloLens 2 Application using MRTK 2. This application used to demonstrate MRTK Utilities and basic setup of a project. The implementation is based on learnings from a project a Microsoft CSE team I was part of did for an enterprise customer. There is a series of blogposts that explain more about the learnings contained in this repo:
An overview of the posts can be found here: Learnings from developing a HoloLens Application - Martin Tirion - Medium. The topics we covered in this sharing are:
- Setting up a Unity-based application for HoloLens with MRTK | by Martin Tirion | Aug, 2022 | Medium
- Adding Application Settings to a Unity-based HoloLens Application | by Martin Tirion | Aug, 2022 | Medium
- Authenticate a HoloLens Application to the Azure AD. | by Martin Tirion | Aug, 2022 | Medium
- A Ready To Use Debug Console for your HoloLens Application | by Martin Tirion | Aug, 2022 | Medium
- Creating a PDF Document Viewer in a HoloLens Application | by Martin Tirion | Aug, 2022 | Medium
In the folder CSE.MRTK.Toolkit.Packages these Unity packages are made available:
- Application base - This provides an Application hierarchy as starting point for the structure of an Unity application using MRTK for HoloLens. In contains some basic classes as well on setting, authentication and more. For more information see Setting up a Unity-based application for HoloLens with MRTK , Adding Application Settings to a Unity-based HoloLens Application and Authenticate a HoloLens Application to the Azure AD
- Debug Console - A debug console prefab using MRTK to show debug messages at runtime. You can also save the messages to a file. For more information see A Ready To Use Debug Console for your HoloLens Application.
- Document Viewer - A document viewer prefab using MRTK and Paroxe (not included) to show PDF documents. For more information see Creating a PDF Document Viewer in a HoloLens Application.
To work with this repo you need these tools:
- Windows 10 or Windows 11 (make sure you update to the latest version)
- Visual Studio 2019 or 2022 Make sure to select Universal Windows Platform development, Game development with Unity and Game development with C++.
- Unity 2020.3 LTS Make sure to select Universal Windows Platform Build Support, Windows Build Support (IL2CPP) to develop for HoloLens.
- Microsoft Mixed Reality Toolkit (MRTK) v2.8 The solution contains the correct MRTK version in the repo. Configuration is done using the Mixed Reality Feature Tool.
When you retrieve this project for the first time from the repo, set it up with these steps:
-
Open the project with Unity 2020.3 (LTS)
-
In the Build Settings (menu open File > Build Settings ...)
-
Under Platform select Universal Windows Platform
-
Click Switch Platform
-
In the Project pane under Assets\Scenes double click Main to open the main scene.
To build the application, execute the Build in the Build Settings dialog. A folder picker dialog will open. Create a Build folder or select the existing one. After the build is done, a Windows Explorer window will open in the Build folder.
A Visual Studio solution is generated from the Unity project. Open the solution (.sln) with Visual Studio. In the top menu bar of Visual Studio select Release and ARM64 for HoloLens deployment.
You can deploy to Device when attached to USB or to Remote over WIFI. If you want to deploy over WIFI, make sure you have set up the Machine Name in the Debugging settings. Right-click the (Universal Windows) project and click Properties. Under Configuration Properties select Debugging. When Remote Machine is selected under Debugger to launch you'll see this UI. Put the IP address of your HoloLens in the Machine Name.
For more information (including setting up your HoloLens for side loading) see Using Visual Studio to deploy and debug - Mixed Reality | Microsoft Docs
For instructions how to package the app to deploy to a HoloLens, see the article Creating the App Package to publish.