Use Unity to develop HoloLens2: 01 environment construction, release and deployment

Recently, I am researching HoloLens2. Although I have read a lot of information, there are still many problems. Moreover, many contents on the Internet are made for the HoloLens generation. Some methods have been abandoned, so it is still troublesome to develop. At present, I Development is still in its infancy, and basic environment and development issues have been resolved (of course there will be new ones, but that's for a later date).

There are actually a lot of information on the Internet about the environment, so I just record it here.

Official Link: MixedRealityToolkit-Unity
Reference Link: HoloLens Development Environment Installation and Deployment

1. Environment construction steps:
1. First, you need to install win10 SDK10.0.18362.0 or above. Download address: win10 SDK
2, Unity version requires 2018.4 or later. You can go to the official website to download, or you can directly search on the Internet, there are many.
3. Pay attention to check the following options when installing VS:
insert image description here
insert image description here
insert image description here

2. Project creation and examples
1. Create a new Unity project and import the MRTK (Mixed Reality Toolkit) resource package
download address
Download the two Unity resource packages Microsoft.MixedRealityToolkit.Unity.Examples.unitypackage and Microsoft.MixedRealityToolkit.Unity.Foundation.unitypackage.insert image description here

2. Some prefabs or assets resources need to use TextMesh Pro, so you need to import the TextMesh Pro resource package, in the menu Window -> TextMeshPro -> Import TMP Essential Resources.
insert image description here
After importing, the current scene needs to be reloaded to take effect. You can open other scenes and reopen the current scene.
3. You can refer to the sample scene, the function is relatively complete
Path: Assets\MixedRealityToolkit.Examples\Demos\HandTracking\Scenes\HandInteractionExamples insert image description here
After opening the scene, the following window may pop up, indicating that the previous step has not been executed to import TMP, click to import directly Yes, reload this scene after importing.
insert image description here
3. Project release 1. Check Virtual Reality Supported
in the XR Settings panel of Player Settings , and click apply if a pop-up box appears.
insert image description here

2. Select the UWP mode for the packaging platform (need to be downloaded and installed), and set the options.
insert image description here

4. HoloLens deployment
1. Use VS to run the packaged .sln file program directly, and perform the following settings insert image description here
2. Click Debug and choose to start execution (not debug)
3. For the first time, you will be asked to enter a PIN to find the developer in HoloLens mode, enter the PIN inside it.

Well, the next step is to wait for the installation. The installation time is still relatively long, which is very time-consuming. I am studying the HoloLens remote connection debugging method.

Guess you like

Origin blog.csdn.net/qq_40138744/article/details/107934663