首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Unity 5.6 VR VRSettings.supportedDevices为空

Unity 5.6 VR VRSettings.supportedDevices为空
EN

Stack Overflow用户
提问于 2017-04-08 16:24:21
回答 1查看 537关注 0票数 0

我正在将我的游戏迁移到Unity 5.6,并尝试使用本地VR对Cardboard的支持。然而,pp根本不会进入VR模式,我猜这是因为当我调用VRSettings.supportedDevices时,会返回一个空的string[]。这款设备是华硕Zenfone 2,它支持VR模式,我一直在VR模式下的Unity旧版本上使用它。

以前有人遇到过这个问题吗?

代码如下:

代码语言:javascript
复制
IEnumerator LoadDevice(string newDevice)
{
    VRSettings.LoadDeviceByName(newDevice);
    yield return null;
    VRSettings.enabled = true;
    Debug.Log ("********************** SUPPORTED DEVICES 2: " + VRSettings.supportedDevices.Length);
    Debug.Log ("********************** DEVICE: " + VRSettings.loadedDeviceName);
    Debug.Log ("********************** ENABLED: " + VRSettings.enabled);

}
EN

回答 1

Stack Overflow用户

发布于 2017-04-08 16:38:21

VRSettings.supportedDevices返回构建时包含的受支持VR设备的列表。

VRSettings.supportedDevices为空,因为您尚未将其添加到编辑器中。您提到了Cardboard,因此从播放器设置中将Cardboard添加到Virtual Reality SDK列表中。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43291834

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档