Hololens2 与Unity 2019.3.13f1使用Holographic Remoting远程连接调试程序

Hololens2 与Unity 2019.3.13f1使用Holographic Remoting远程连接调试程序

最近购置Hololen2后,使用Unity 2017.3.1f1与Hololens2远程连接失败。官方文件(https://docs.microsoft.com/en-us/windows/mixed-reality/install-the-tools)说需要安装Unity2018.4.x或更新的版本。安装Unity 2019.3.13f1后调试成功,在这里把调试经验分享给大家。

一、Unity的卸载和安装

保险起见,建议大家把Unity卸载后再安装新版本。

  1. 使用360软件管家卸载Unity2017.3.1f1,如果有Unity Hub一起卸载。
  2. 关闭所有杀毒软件,进行Unity Hub和Unity 2019.3.13f1的安装。
  3. 安装完成。Hololens2 与Unity 2019.3.13f1使用Holographic Remoting远程连接调试程序

二、下载并导入Mixed Reality Toolkit

  1. 下载Mixed Reality Toolkit(https://github.com/Microsoft/MixedRealityToolkit-Unity/releases)。Hololens2 与Unity 2019.3.13f1使用Holographic Remoting远程连接调试程序
  2. 打开Unity,新建项目。Hololens2 与Unity 2019.3.13f1使用Holographic Remoting远程连接调试程序
  3. 转换到UWP平台。Hololens2 与Unity 2019.3.13f1使用Holographic Remoting远程连接调试程序
  4. 在Player Settings中勾选Virtual Reality Support,并选择Windows Mixed Reality。Hololens2 与Unity 2019.3.13f1使用Holographic Remoting远程连接调试程序
  5. 导入四个MRTK包,注意先导入Foundation包,不然会报错。
  6. 导入成功后,弹出MRTK的窗口,点击Apply。
  7. ‘Mixed Reality Toolkit’-‘Add sence’,添加一个场景。Hololens2 与Unity 2019.3.13f1使用Holographic Remoting远程连接调试程序
  8. 运行场景。Hololens2 与Unity 2019.3.13f1使用Holographic Remoting远程连接调试程序

三、Hololens2配置

  1. 在Hololens2中打开Microsoft Store,下载并安装Holographic Remoting。
  2. 打开Holographic Remoting,可以看到Hololens2的IP地址。

四、远程连接

1. 保证电脑和Hololens2连接同一个WIFI
2. 保持Holographic Remoting在Hololens2中打开。
3. 点击’Window’-‘XR’-‘Holographic…’。选择’Remote to device’Hololens2 与Unity 2019.3.13f1使用Holographic Remoting远程连接调试程序Hololens2 与Unity 2019.3.13f1使用Holographic Remoting远程连接调试程序
4. 输入Hololens2的IP,‘Device’选择’Hololens2’,点击’Connect’。
5. ‘Connect’变绿后说明连接成功,同时Hololens2中原有显示IP的界面消失。
6. 运行即可在Hololens2中看到程序运行结果。

参考教程

[1] Hololens2开发入门教程<https://www.bilibili.com/video/BV1Wz411z7a1/?p=2&t=269>
[2] Hololens开发之远程连接<https://blog.****.net/qiao_19/article/details/79438408>
[3] Holographic Remote Player官方文档<https://docs.microsoft.com/en-us/windows/mixed-reality/holographic-remoting-player>