Google cardboard device orientation

时光毁灭记忆、已成空白 提交于 2019-12-11 02:34:23

问题


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').

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?


回答1:


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



来源:https://stackoverflow.com/questions/28402259/google-cardboard-device-orientation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!