1.开发环境
- Win10
- Unity 2020.3.24f1c2
- MRTK 2.7.x
- VS 2019
- HoloLens 2
2.下载Unity
- 注意点:添加
Universal Windows Platform Build Support
和Windows Build Support (IL2CPP)
模块
3.下载MRTK
- 使用MRFT导入
4.项目配置
- 注意点:官方步骤Unit 4 of 8的
Create the scene and configure MRTK
步骤处第四步,配置文件换为DefaultHoloLens2ConfigurationProfile
5.导入示例
Mixed Reality->Toolkit->Utilities->Import Examples from Package(UPM)
Import导入(建议HandInteractionExamples 场景)- Assets->Sample处找到
6.在Unit中通过WIFI连接HoloLens 2
- Mixed Reality->Remoting->Holographic Remoting for Play Mode
- Remote Host Name输入HoloLens 2 IP
- 点击 Enable Holographics Remoting for Play Mode
7.在VS中通过WiFi连接HoloLens 2
- Unity工程导出到VS
- File->BuikdSettings->Build
- 打开sln工程,
Release
、ARM64
、Remote Machine
- 属性中 调试(Debugging)->计算机名(Machine Name):HoloLens 2 IP地址
- 运行程序,输入PIN码。注意这个PIN不是你开机的PIN,需要在眼镜中设置->更新与安全->开发者选项->配对 会弹出一个PIN码
8.参考
混合现实文档
HoloLens 2 基础知识:开发混合现实应用程序
MRTK
MRTK Github
Hololens 2 + Unity环境配置
HoloLens2+Unity3d 2020.3+MRTK 2.7环境配置说明
HoloLens2之路-Unity2020.3+MRTK2.7配置