我关注了这个Unity Blog Post tutorial。一切都在Unity IDE中工作,但是当我构建它时,UWP应用程序抛出异常:
InvalidOperationException: Enable VR Streaming to allow connection to remote holographic device
我的Unity版本:2018.03
有人知道任何解决方法吗?
如果使用MRTK,请使用菜单项应用项目设置。
Mixed Reality Toolkit > Configure > Apply Mixed Reality Project Settings
否则,请关注使用hololens / Unity的微软instructions,你联系的教程已经完成了。关键选项很可能是:
Player Settings > Universal Windows Platform tab > XR Settings group > Virtual Reality Supported
这是一个解决方案:
至于在Unity UWP构建中使用Holographic Remoting功能,您应该在Player XR设置中打开'WSA Holographic Remoting'并加载两个SDK,第一个应设置为'None',第二个设置为'Windows Mixed Reality' 。如果您不这样做,您的UWP应用程序将在混合现实门户而不是普通应用程序中打开。
您是否在WindowsMR
方法中的脚本中的任何位置加载Start()
SDK,如下所示:
private void Start()
{
StartCoroutine(LoadingWindowsMrWrapper());
}
private IEnumerator LoadingWindowsMrWrapper()
{
yield return new WaitForSeconds(1);
StartCoroutine(LoadDevice("WindowsMR"));
}
private static IEnumerator LoadDevice(string newDevice)
{
XRSettings.LoadDeviceByName(newDevice);
yield return null;
XRSettings.enabled = true;
}
如果您有UI Connect按钮,则可以调用HolographicRemoting.Connect(ipAddress);
。到现在为止你应该联系。
在申请退出之前,请确保您已断开连接。
如果它没有为您锻炼,请告诉我。