简体   繁体   中英

Unity VR scene to 2D scene

Does anyone have any idea how to switch unity VR mode scene to normal 2D scene? i have number of 2D and VR scenes in my application and want a button through which user can enter into VR scene and after then easily return back to normal 2D scenes. I successfully done switching scene between 2D to VR but now my app stuck in VR to 2D switching.

If you look into the documentation on Hybrid Apps with Google VR , it explains how you can go between 2D and VR.

Essentially, you will have to include under the Player Settings -> XR Settings -> Virtual Reality SDKs the "None" SDK. You may want to use something like string vrDeviceName = XRSettings.loadedDeviceName to store what your VR SDK is when in VR.

You also have to be familiar with using Coroutines , since when you change the view VR view type, you need to wait one frame.

To switch to 2D, you have to start a coroutine call XRSettings.LoadDeviceByName(""); and wait one frame, and then adjust the camera (if needed).

To switch back to VR, you start a coroutine to do XRSettings.LoadDeviceByName(vrDeviceName); and again wait one frame.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM