官术网_书友最值得收藏!

Building for GearVR and Oculus Go

To build for Samsung GearVR and Oculus Go mobile devices, you will use the Oculus SDK. These are both Android-based devices so you must set up your development machine for Android development as described previously (Oculus Go is binary and compatible with GearVR). Then complete the following steps in Unity:

  1. Configure your Unity Build Settings to target the Android platform.
  2. In Player Settings, under XR Settings, set Virtual Reality Enabled
  3. Ensure Oculus is at the top of the Virtual Reality SDKs list.
  4. Download and Install the Oculus Integration package from the Asset Store, as instructed previously.

Now we will add the OVR camera rig to the MeMyselfEye object in our scene. These steps are like the Standalone Oculus Rift setup described previously. In this case, you can use the same MeMyselfEye prefab for both Rift and GearVR.

  1. Look in your Project window; under the Assets folder you should have a folder named OVR.
  2. Within that is a subfolder called Prefabs. Drag the prefab named OVRCameraRig from the Assets/OVR/Prefabs/ folder into your Hierarchy. Place it as a child object of MeMyselfEye.
  3. Set its height to 1.6 by setting its Transform to Position to (0, 1.6, 0).
  1. Disable the Main Camera object also under MeMyselfEye. You can disable objects by unchecking the enable-checkbox in the top-left of its Inspector window. Alternatively, you can just delete the Main Camera object.
  2. Save the prefab by selecting MeMyselfEye in Hierarchy, then press its Apply button in the Inspector.

Now, you can build your game as a separate executable app using the following steps:

  1. From the main menu bar, navigate to File | Build Settings...
  2. If the current scene is not already in the Scenes to Build list, press Add Open Scenes
  3. Click on Build and Run and set its name to Diorama
  4. I like to keep my builds in a subdirectory named Build; create one if you want to.
  5. Click on Save

An Android APK file will be created in your Build folder and uploaded to your attached Android device.

For more information on Unity support for Oculus SDK, see https://docs.unity3d.com/Manual/VRDevices-Oculus.html.

主站蜘蛛池模板: 乐平市| 开远市| 宜川县| 开远市| 津南区| 建瓯市| 汉中市| 怀仁县| 凤台县| 临颍县| 平凉市| 明溪县| 玉林市| 永年县| 双柏县| 苍山县| 漯河市| 郓城县| 沙洋县| 海口市| 浮梁县| 镶黄旗| 龙井市| 浙江省| 咸丰县| 文登市| 建湖县| 呼伦贝尔市| 岳阳县| 普定县| 南宁市| 广德县| 承德县| 南溪县| 鸡西市| 资阳市| 文登市| 若尔盖县| 嫩江县| 黔西县| 察哈|