Accessing Main Camera Left and Right in Unity / google-vr

谁说我不能喝 提交于 2020-01-03 06:18:22

问题


This is a follow up to this question regarding how to display objects on one camera only in google-vr and unity.

In the current demo project of Unity and Google-vr, I can only access Main Camera Left and Main Camera Right while running the game. During runtime, I am able to disable a layer with the culling mask of one camera.

But I am not able to save those changes while running the game. If I stop, the two Main Cameras Left/Right disappear and I only see Main Camera and GvrReticle as child. I suspect the cameras are created or imported from a prefab during runtime.

What would be the right way to have the left / right cameras accessible when not running the screne?


回答1:


It's mentioned in the guide:

Often you will wish to add the stereo rig to your scene in the Editor rather than at runtime. This allows you to tweak the default parameters of the various scripts provided in this plugin, and provides a framework on which to add additional scripts and objects, such as 3D user interface elements.

To turn your Camera into a stereo camera, select the Camera (or Cameras) in the Hierarchy panel, then execute the main menu command Component > Google VR > Update Stereo Cameras.



来源:https://stackoverflow.com/questions/38279290/accessing-main-camera-left-and-right-in-unity-google-vr

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