Unity Virtual Reality Projects
上QQ阅读APP看书,第一时间看更新

Setting your XR SDK

When your project is built with Virtual Reality Supported enabled in Player Settings, it renders stereoscopic camera views and runs on an HMD:

  1. Go into Player Settings (Edit | Project Settings | Player).
  2. In the Inspector window, find the XR Settings at the bottom and check the Virtual Reality Supported checkbox.
  3. Choose the Virtual Reality SDK you will require for your target device. Refer to the previous table.

Depending on the target platform you are using, the Virtual Reality SDKs available in your Unity installation will vary. If your target VR is shown, then you're good to go. You can add others by pressing the ( + ) button in the list, and remove ones pressing the ( - ) button.

For example, the following screenshot shows the Virtual Reality SDKs selected for the Standalone platform. With Virtual Reality Supported enabled, the app will use Oculus SDK if it can. If the app cannot initialize the Oculus SDK at runtime, it will then try the OpenVR SDK.

At this point, by pressing Play in the Unity Editor you may be able to preview your scene in VR. Different platforms support Play mode in different ways. Some do not support Editor previews at all.