Google硬纸板设备方向 [英] Google cardboard device orientation

查看:102
本文介绍了Google硬纸板设备方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道...是否可以将设备方向设置回自动旋转"?我的应用程序主屏幕需要纵向旋转,但是一旦导入Cardboard SDK软件包,横向模式似乎就会绕过项目中的所有内容,并且无法在任何场景中进行更改,甚至无法从Input.deviceOrientation获取方向. (始终为未知").

I'm wondering... is there any way to set the device orientation back to 'Auto Rotation'? I need a portrait rotation for my app main screen but once Cardboard SDK package is imported landscape mode seems to bypass everything in the project and there is no way to change it in any scene and I can't even get the orientation from Input.deviceOrientation (is always 'unknown').

到目前为止,我唯一的想法是使用第二个标准摄像头(角度为90度)让我在人像单声道模式下显示,并检查角度以手动获取对人像或风景输入的更改.

So far my only idea is to use a second standard camera in ninety degree angle to get my dispay in portrait-mono mode and check the angle to manually get the change to portrait or landscape input.

我仍然没有尝试过,但是在我看来它可以工作,但肯定不是一个优雅的解决方案...

I still didn't try this but it seems to me that it will work but isn't certainly an elegant solution...

...所以有人知道是否可以执行类似于内置自动旋转"的操作,或者有比我更好的建议来完成此任务?

... so anyone knows if it's possible to do something similar to the built in 'Auto Rotation' or has a better proposal than mine for this task?

推荐答案

好的,经过一些研究,我发现了这个问题. Pugnis/Android路径中的AndroidManifest文件有一行会覆盖旋转状态:'android:screenOrientation ="landscape".只需删除该行自动旋转即可正常运行

Ok, after some research I've found the issue. The AndroidManifest file in Pugnis/Android path has a line which overwrites the rotation status: 'android:screenOrientation="landscape". Just deleting that line auto rotation is working properly

这篇关于Google硬纸板设备方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆