Skip to main content
 首页 » 资源教程 » Unity3D教程

Oculus Unity Development Guide开发指南

2016年09月09日 19:55:171880

Welcometo the Unity Development Guide


Welcometo the Oculus Unity Developer Guide.


Thisdocument describes developing Unity 3D games and applications for VR deviceswith the Oculus PC and mobile SDKs. A Unity integration package, sample Unityapplications, and mobile SDK Unity examples are available for PC and mobiledevelopment to help you create virtual reality applications in Unity.

本文档描述了如何在使用Oculus PC及移动端SDK为VR设备开发U3d游戏及应用。我们提供了Unity整合包、Unity应用实例,以及移动SDK Unity实例来为PC及移动端开发工作提供帮助,帮助你在Unity中创造VR应用。

Thisguide covers:

•Getting started

•Downloading and installing the Oculus Unity integration

•Contents of the integration package

• Howto use the provided samples, assets, and sample applications

•Configuring Unity VR projects for build to various targets


• 如何开始

• 下载并安装OculusUnity整合包

• 整合包中的内容

• 如何使用当中的实例、组件以及实例应用

• 怎样对应多平台的生成方式

ThisUnity Integration is available for use with the PC development environment forthe Oculus Rift. It is also bundled with the mobile SDK for Samsung Gear VR.Both Unity integrations are capable of building targets for PC or Android.However, keep in mind that the requirements and optimizations for PC and mobileVR applications differ substantially. If you would like to generate builds forboth PC and mobile from a single project, it is important to follow the morestringent mobile development best practices.

本次的Unity整合包可以用来在PC上针对OculusRift的开发环境下使用,同时也可以随着三星Gear VR的移动SDK一起使用。另外整合包可以同时应对PC和安卓的两种生成方式。不过需要注意的是,PC与移动VR应用在需求以及优化上是存在本质区别的。如果你想让一个单独的项目同时生成在PC端和安卓端上,那么必须注意遵循更加严格的移动开发最佳实践(best practices)。

Thisdocument describes the mobile Unity integration release 0.4.3. Most informationcontained in this guide also applies to the PC Unity integration .4.4. Any exceptionsare clearly indicated where they occur (e.g., the Moonlight folder in OVRcontains assets relevant only to mobile development).

本文档描述了移动Unity整合包,版本0.4.3。本指南中包含的绝大多数信息也可以同时运用在PC Unity整合包里.4.4。如有不同之处一般都会当场指出(比如说OVR里的Moonlight文件夹里包含的组件只和移动开发有关)


Systemand Hardware Requirements系统和硬件需求

Pleasereview the relevant documentation to be sure that you are using supportedhardware and that your development environment and devices are configured andset up properly:

• PCSDK: OculusDeveloper Guide

•Mobile SDK: Deviceand Environment Setup Guide

Beforebeginning Unity development, you should be able to run the available SDK Unitydemo applications.


• PC端SDK: OculusDeveloper Guide

• 移动端SDK: Deviceand Environment Setup Guide

在开始Unity开发工作之前,你应该可以先运行一下手头已经拥有了的SDK Unity Demo应用。

UnityRequirements Unity需求

TheOculus Unity Integration is compatible with Unity Pro 4.6.1 , which includessupport for Lollipop (Android 5.0).

整合包可以由Unity Pro 4.6.1进行编译,因为其也包含了对Lollipop棒棒糖(安卓5.0)的支持。

Note:For mobilebuilds, we strongly recommend using Unity 4.6.2p2 or higher, which includeimportant fixes for a memory leak and a null reference bug.

注意:对于移动端的生成,我们强烈建议使用Unity 4.6.2.p2或者更高的版本,因为会对内存溢出或者空引用BUG的情况作出重要修正。

Unity Free support is available with Unity 4.6 or higher. Afeature set comparison between Unity Pro and Unity Free may be found here:


Note: Thereare noteworthy feature support differences between Unity licenses. Pleasereview the limitations cited below as well as the license comparison on Unity’swebsite before committing considerable resources to one path. Your licensechoice will depend largely on the performance characteristics and distributionneeds of your app.


Gamepad Controller

You may wish to have a compatible gamepad controller for use withthe supplied demo applications, such as the Xbox 360 controller for Windows, anHID-compliant game controller for Mac, or a Samsung EI-GP20 or other compatiblecontroller for Gear VR.

Oculus Unity


你也许会需要有一个可供编译的游戏手柄在受支持的Demo应用当中,比如对应windows的Xbox 360手柄,对应Mac的HID-compliant游戏手柄或者一部三星 EI-GP20或其他对应Gear VR的其他可编译控制器。

Oculus/GearVR开发者群 544405366


All Oculus Unity development materials are available for downloadat our Developer site (requires login):


The Oculus Unity Integration is the heart of the supplieddevelopment resources - it installs the minimum set of required files necessaryfor VR integration into Unity. We have also included various assets, scripts,and sample applications to assist with development.

Oculus Unity整合包是整个开发资源中的核心——它会在最低限度上为你安装所有必要的用以开发VR的文件。我们同样在里面放入了多种组件、脚本以及应用实例来辅助开发过程。

The Mobile SDK also includes Unity example source code illustratingthe construction and use of common resources such as simple rooms, menus, andmore. They may be found in the folder SDKExamples. See Oculus Mobile SDKExamples formore information.

移动SDK同样包含了Unity实例资源代码来说明各种结构以及大部分资源的使用方法比如simpleRooms、Menus等等。它们可以在文件夹SDKExamples里找到。参阅Oculus MobileSDKExamples以获得更多信息。

The PC Unity Integration bundle includes PC Unity整合包捆绑内容有:

• OculusUnityIntegration(Oculus Unity 整合包)

The mobile SDK includes the following移动SDK包含有:

• OculusUnityIntegration(Oculus Unity 整合包)

• BlockSplosion sample application (source and pre-built apk) 应用实例 (资源以及预生成apk)

• Shadowgun sample application (pre-built-apk) 应用实例 (预生成apk)

• SDKExamples (source) (资源)

Preparing for Development: PC SDK准备工作:PC SDK

When developing for PC, we recommend beginning with the Oculus Developer Guide and theOculus Best Practices Guide, whichincludes information and guidelines for developing great VR experiences, andshould be considered a go-to reference when designing your Oculus-ready games.

当在PC上做开发时,我们推荐先从OculusDeveloper Guide 和Oculus Best Practices Guide两部文档开始,因为它们包含了如何开发牛逼VR体验项目的信息和指导,而且当你准备好要设计一个Oculus作品时也可以将它们作为一个直观的参考。

Direct Mode Display Driver直观显示模式驱动

On Windows, Oculus recommends users install the Oculus DisplayDriver, which includes a feature known as Direct Display Mode. In direct mode,the driver makes your Rift behave as an appliance instead of a standard Windowsdisplay. Applications target the Rift by loading the driver and pointingrendering to it before initialization. This is the default behavior. Forcompatibility, the Rift can also still be used as a Windows monitor.

在windows上,Oculus推荐用户安装上Oculus Display Driver,其中有个功能叫做Direct Display Mode(直观显示模式)。在直接模式里,驱动程序会将你的Rift设置为取代Windows标准屏幕的显示器。应用程序在读取驱动之后会直接标记Rift并在初始化之前先行把渲染工作做好。这是一种默认的行为模式。为了考虑兼容性,Rfit也能作为windows的显示屏来使用。

This is known as Extended Display Mode. When extended mode isactive, rendering works as usual, with no Oculus intervention. You can choosethe mode from the Oculus Configuration Utility's Rift Display Mode screen.


The direct mode driver is not yet available for platforms otherthan Windows.


Monitor Setup显示器设置

To get the best experience, you and your users should alwaysconfigure the Rift correctly.


In Windows 7 and Windows 8, you can change Windows' displaysettings by right-clicking on the desktop and selecting Screen resolution.


• It is possible to clone the same image on all of your displays.To ensure each display uses the correct

frequency, Oculus recommends extending the desktop instead ofcloning it.

• 可以把图像克隆到不同的屏幕上。但为了确保每个屏幕都使用了正确的频率,Oculus推荐最好还是扩展桌面而不是简单复制。

• If you are using the Rift in extended mode, it should be set toits native resolution. This is 1920x1080 for DK2 and 1280x800 for DK1.

• 如果你是在扩展模式下使用Rift,那么最好将它设置为原生分辨率。对于DK2来说是1920x1080,对DK1来说就是1280x800。

On Mac systems open System Preferences, and then navigateto Displays.


• As with Windows, it is possible to mirror the same image on allof your displays. Oculus recommends against mirroring. Click Arrangement andensure Mirror Displays is not enabled.

• 在windows里可以直接把图像镜像到所有屏幕上。但Oculus推荐还是不要镜像。点击Arrangement并确保Mirror Displays没有启用。

• Some Unity applications will only run on the main display. Inthe Arrangement screen, drag the white bar onto the Rift's blue box tomake it the main display.

• 有些Unity应用只会在主要屏幕上显示。在Arrangement界面,拖动白条把Rift的蓝色盒子设置为主屏幕。

• Always use the Rift's native resolution and frequency. Click GatherWindows. For DK2, the resolution

should be Scaled to 1080p, the rotation should be 90° andthe refresh rate should be 75 Hertz. For DK1, the resolution should be1280x800, the rotation should be Standard, and the refresh rate should be 60Hertz.

• 常态保持Rift为原生分辨率和频率。点击GatherWindows。对DK2来说,分辨率应该调Scaled到1080p,旋转角(rotation)应该是90°而刷新率应该是75Hz。对DK1来说,分辨率应该是1280x800,旋转角设置为标准,刷新率应该是60Hz。

Recommended Configuration推荐配置

We recommend the following settings in your project:


• On Windows, enable Direct3D 11. D3D 11 and OpenGL expose themost advanced VR rendering capabilities. In some cases, using D3D 9 may resultin slightly reduced visual quality or performance.

• 在windows上,启用Direct3D 11。D3D 11和Open GL能最大限度展现VR的渲染能力。在某些情况下,用D3D 9可能会导致画质或表现的轻微下降。

• Use the Linear Color Space. Linear lighting is not only morecorrect for shading, it also causes Unity to perform sRGB read/write to the eyetextures. This helps reduce aliasing during VR distortion rendering, where theeye textures are interpolated with slightly greater dynamic range.

• 使用线性的颜色空间(linear color space)。线性光并不仅仅正确作用于着色(shading),它还可以让Unity在肉眼材质上展现sRGB的读/写。这一点可以帮助VR在渲染失真时降低混淆程度,尤其是在肉眼材质被轻微的大动态范围(slightly greater dynamic range)改动时。

• Never clone displays. When the Rift is cloned with anotherdisplay, the application may not vsync properly.

This leads to visible tearing or judder (stuttering or vibratingmotion).

• 不要复制屏幕。当Rift被克隆到另一块屏幕时,应用程序可能没办法完美同步。


• On Windows, always run DirectToRift.exe. Even in extended mode,DirectToRift.exe makes your application run full-screen on the Rift.

• 在windows上保持运行DirectToRift.exe。哪怕在扩展模式中,DirectToRift.exe也能让你的应用程序在Rift上保持全屏。

• When using the Unity editor, use extended display mode. Directmode is currently supported only for

standalone players. Using it with the Unity editor will result ina black screen on the Rift.

• 在使用Unity编辑器时,使用扩展屏幕模式。直观模式目前仅支持单一玩家。用Unity编辑器打开它有可能会导致Rift上的黑屏。

Oculus/GearVR开发者群 544405366

Preparing for Development: Mobile SDK


When developing for mobile, please be sure to fully review all ofthe relevant performance and design

documentation, especially the MobileUnity Best Practices guide. Mobile apps are subject tomore stringent limitations and requirements and computational limitations whichshould be taken into consideration from the ground up.

当针对移动端进行开发时,请先保证完全浏览过所有相关的表现和设计文档,特别是Mobile Unity Best Practices guide.移动应用意味着要一直考虑更严格的限制和需求以及从头到尾都要一直考虑的计算限制。

We hope that the process of getting your Oculus device integratedinto your Unity environment is a fun and easy experience.


Getting Started开始

This section describes steps taken to begin working in Unity.


Importing the Unity Integration


If you are already working in a Unity project, save your workbefore beginning.


First, create a new project that you can import the Oculus assetsinto. From the Unity menu, select File > New Project. Clickthe Browse button and select the folder where the Unity project will belocated.

Make sure that the Setup defaults for: field is set to 3D.

首先,创建一个新的项目来导入Oculus组件。在Unity菜单里,选择文件—新项目。点击Browse按钮选择放置Unity项目的文件夹位置。确保Setup defaults for:区域选择的是3D。

You do not need to import any standard or pro Unity assetpackages, as the Oculus Unity integration is fully selfcontained.

不需要再导入任何标注或Pro Unity组件包,因为Oculus Unity整合包已经完全包含进去了。

Click the Create button. Unity will reopen with the newproject loaded.


To import the Integration into Unity, select Assets > CustomPackage... and select the Unity Integration .unitypackage to import theassets into your new project. Alternately, you can locate the .unitypackagefile and double-click to launch, which will have the same effect.

要想把整合包导入Unity,选择Asset—Custom Package…并选择Unity Intergration.unitypackage来把组件都导入到你的新项目里。当然你也可以直接双击那个文件,效果是一样的。

When the Importing package dialog box opens, leave all ofthe boxes checked and select Import. The import process may take a fewminutes to complete.


Mobile SDK: the mobile Unity Integration includes a ProjectSettings folder which provides default settings for a VR mobile application.You may manually copy these files to your [Project]/Assets/ProjectSettingsfolder.

移动SDK:移动Unity整合包包含了一个Project Settings文件夹,可以为VR移动应用提供默认设置。你也可以自行将这些文件复制到你的[项目]/Assets/ProjectSettings文件夹下。

Importing Sample Applications


In this section we'll describe how to import sample Unityapplication source into Unity, using BlockSplosion as an example.


Note: Sampleapplication import is relevant to mobile only. The Room sample applicationprovided for PC development is included as a scene in the UnityIntegrationpackage.


If you are already working in a Unity project, save your workbefore beginning.


To import the Integration into Unity, select Assets > CustomPackage... and select BlockSplosion.unitypackage to import the assets intoyour new project. Alternately, you can locate the BlockSplosion.unitypackagefile and double-click to launch, which will have the same effect.

The import process may take a few minutes to complete.



Adding VR to an Existing Unity Project


The Unity Integration package may be used to integrate Oculus VRinto an existing project. This may be useful as a way of getting oriented to VRdevelopment, but dropping a VR camera into a Unity game that wasn't designedwith VR best practices in mind is unlikely to produce a great experience.

Unity整合包可以用来将Oculus VR整合进一个已有的项目里。在面向VR开发的道路上这个方法会非常有用,但是把一个VR摄像头随便扔进一个并不是为VR设计的Unity游戏中,如果事先并没有在脑海里经过仔细构想(bestpractices)的话,可能没办法产生良好的体验效果。

Note: This isone simple method for adding VR to an existing application, but is by no meansthe only way. For example, you may not always wish to use OVRPlayerController.


1. Importpackage

2. InstantiateOVRCameraRig if you already have locomotion figured out or instantiateOVRPlayerController to walk around.

3. Copyany scripts from the non-VR camera to the OVRCameraRig. Any image effectsshould go to both the Left/RightEyeAnchor GameObjects that are children of theOVRCameraRig.

4. Disableyour old non-VR camera.

5. Buildyour project and run normally.

1. 导入包

2. 实例化一个OVRCameraRig,如果你已经搞懂了移动方面的内容或者通过实例化OVRPlayerController来负责移动。

3. 把所有非VR摄像头的脚本都复制到OVRCameraRig里。所有的图像效果都应该直接放到OVRCameraRig下的Left/RightEyeAnchorGameObjects里。

4. 把你之前的非VR摄像头通通Disable掉。

5. 像平常那样生成你的项目并运行。

A Detailed Look at the Unity Integration


This section examines the Unity integration, including thedirectory structure of the integration, the Unity prefabs are described, andseveral key C# scripts.


Note: Thereare minor differences between the contents of the Unity Integration providedfor PC development and the version bundled with the mobile SDK.

注意:分别针对PC开发和捆绑在移动SDK上的Unity 整合包在内容上几乎没什么区别。




The contents of the OVR folder inOculusUnityIntegration.unitypackage are uniquely named and should be safe toimport into an existing project.


The OVR directory contains the following subdirectories:


Oculus Unity Development Guide开发指南 Unity3D教程 第1张

Editor编辑器   包含可以为Unity编辑器添加功能的脚本,还有强化过的C#组件脚本。

Materials材料    包含了整合包中图形组件会用到的材料,比如主要GUI屏幕。

Moonlight    包含了针对移动Gear VR开发而准备的类(仅针对移动端)。

Prefabs预制体    包含了为了将VR嵌入Unity场景而提供框架的主要预制体:OVRCameraController和OVRPlayerController。

Resources资源    包含了部分需要被OVR脚本实例化的预制体和其他对象,比如主GUI。

Scene    场景包含了简单的场景。

Scripts脚本    包含了将VR框架和Unity组件结合起来的C#文件。许多脚本都要结合多种预制体一起使用。

Shaders着色器    包含了多种Cg着色器,某些OVR组件会用得上。

Textures纹理    包含了图像部件,某些脚本组件会用得上。

Note: Westrongly recommend that developers not directly modify the included OVR scripts.


Oculus/GearVR开发者群 544405366


The Plugins folder contains the OculusPlugin.dll, which enablesthe VR framework to communicate with Unity on Windows (both 32 and 64-bitversions).


This folder also contains the plugins for other platforms:OculusPlugin.bundle for MacOS; and Android/, vrlib.jar, andAndroidManifest.xml for Android.




The current integration for adding VR support into Unityapplications is based on two prefabs that may be added into a scene:


• OVRCameraRig

• OVRPlayerController

To use, simply drag and drop one of the prefabs into your scene.


Note: You canalso add these prefabs into the scene from the Oculus - Prefabs menu.



OVRCameraRig replaces the regular Unity Camera within a scene. Youcan drag an OVRCameraRig into your scene and you will be able to start viewingthe scene with the Gear VR and Rift.

OVRCameraRig在场景中用来替换掉常规的Unity Camera。你只要把这东西拖进场景就可以直接开始在Gear VR或者Rift里看到画面了。

Note: Makesure to turn off any other Camera in the scene to ensure that OVRCameraRig isthe only

one being used.


Figure 15: Prefabs: OVRCameraRig,expanded in the inspector

Oculus Unity Development Guide开发指南 Unity3D教程 第2张

OVRCameraRig contains two Unity cameras, one for each eye. It ismeant to be attached to a moving object (such as a character walking around, acar, a gun turret, etc.) This replaces the conventional Camera.


The following scripts (components) are attached to theOVRCameraRig prefab:


• OVRCameraRig.cs

• OVRManager.cs


The OVRPlayerController is the easiest way to start navigating avirtual environment. It is basically an OVRCameraRig prefab attached to asimple character controller. It includes a physics capsule, a movement system,a simple menu system with stereo rendering of text fields, and a cross-haircomponent.

可以说是最简单的一种用来定位虚拟环境的方式了。它简单来说就是把一个OVRCameraRig预制体跟一个简单的character controller给绑在了一起。它包含了一个物理capsule,一个移动系统,一个简单的有立体感文字区域渲染的菜单系统,还有一个cross-hair组件。

To use, drag the player controller into an environment and beginmoving around using a gamepad, or a keyboard and mouse Note: Make sure thatcollision detection is active in the environment.

要使用的话,把player controller拖到环境里面并且用游戏控制器来移动他,或者键盘和鼠标。


Two scripts (components) are attached to the OVRPlayerControllerprefab:


• OVRPlayerController.cs

• OVRGamepadController.cs

Figure 16: Prefabs: OVRPlayerController,expanded in the inspector

Oculus Unity Development Guide开发指南 Unity3D教程 第3张

Unity Components


The following section gives a general overview of what each of thescripts within the Scripts folder does.



OVRCameraRig is a component that controls stereo rendering andhead tracking. It maintains three child "anchor" Transforms at theposes of the left and right eyes, as well as a virtual "center" eyethat is half-way between them.


This component is the main interface between Unity and thecameras. This is attached to a prefab that makes it easy to add VR support to ascene.

Important: All camera control should be done through thiscomponent. You should understand this script when implementing your own cameracontrol mechanism.



OVRManager is the main interface to the VR hardware. It includeswrapper functions for all exported C++ functions, as well as helper functionsthat use the stored Oculus variables to help configure camera behavior.


This component is added to the OVRCameraRig prefab. It can be partof any application object. However, it should only be declared once, becausethere are public members that allow for changing certain values in the Unityinspector.


OVRManager.cs contains the following public members:


Table 4: Mobile and PC Public Members移动和PC端的public成员

Oculus Unity Development Guide开发指南 Unity3D教程 第4张


EyeTexture Format肉眼纹理格式设置肉眼渲染纹理的格式。一般情况下你应该使用Default或者DefaultHDR来对应高动态范围渲染。

EyeTexture Depth肉眼纹理深度设置肉眼渲染纹理的深度精度。有可能会用付出性能代价的方式来修复z-fighting效果。

EyeTexture Antialiasing肉眼纹理抗锯齿为肉眼渲染纹理设置抗锯齿等级。

Table 5: PC-Only Public Members只在PC端独有的public成员

Oculus Unity Development Guide开发指南 Unity3D教程 第5张

NativeTexture Scale原生纹理比例在camera controller里的每一个摄像头都会创建一个渲染纹理,有着能获得最清晰的像素密度的理想比例(一个1-to-1的像素尺寸能在屏幕中间展示透镜失真效果)。这个区域可以用来把一个摄像头的渲染对象从尺寸的角度调整到可以针对多个理想像素保真度的程度,以便让你能够在性能和质量之间找到平衡点。

VirtualTexture Scale虚拟纹理比例如有必要,这个区域可以用来动态调整摄像头的渲染对象,以使其值低于理想状态下的像素密度,可以在运行时帮助降低GPU占用。

UsePosition Tracking 使用位置追踪如果禁用,则由追踪器侦测到的位置坐标会停止更新HMD坐标。

UseRotation Tracking 使用旋转角追踪如果禁用,则由追踪器侦测到的定向会停止更新HMD定向。

Mirrorto Display 镜像屏幕如果Oculus直观显示驱动已被启用,而且这个选项也被选中的话,画面会在除了Rift之外的桌面窗口中出现。禁用这个选项会轻微提高性能。

TimeWarp(desktop only)时间扭曲(仅供桌面)TimeWarp是一个调整经过渲染的图像在屏幕上显示位置的技术,当某个时间点用户能看到它的时候给予最后追踪姿态的情况作出调整。启用这个选项会强制执行垂直同步,并且会使其他时间上的调整的等待时间降低。

FreezeTime Warp(desktop only) 冻结时间扭曲(仅供桌面)启用这个选项会在时间扭曲时暂时冻结经过渲染的眼部姿态(renderedeye pose)来说明这个效果。

ResetTracker On Load 读取时重置追踪器这个选项默认为True。关掉的话,在读取随后的场景时将不会重置追踪器。这样就可以在场景切换时保持原有的朝向了,同时会保持磁力计(magnetometer)设置完整。

Helper Classes


In addition to the above components, your scripts can alwaysaccess the HMD state via static members of OVRManager.除了上述组件之外,你的脚本还会经常通过OVRManager里的静态成员访问HMD状态。

Oculus Unity Development Guide开发指南 Unity3D教程 第6张

OVRDisplay 提供HMD渲染时的状态以及姿态(pose)。

OVRTracker 提供姿态(pose)、视锥体,以及红外追踪摄像头的追踪状态。


OvrCapi is a C# wrapper for LibOVR (specifically, CAPI). Itexposes all device functionality, allowing you to query and set capabilitiesfor tracking, rendering, and more. Please refer to the Oculus Developer Guideand reference manual for details.


Oculus Unity Development Guide开发指南 Unity3D教程 第7张

OVRCommon OVRCommon is a collection of reusable static functions,including conversions between Unity and OvrCapi types.



The following classes are optional. We provide them to help youmake the most of virtual reality, depending on

the needs of your application.


Oculus Unity Development Guide开发指南 Unity3D教程 第8张

Oculus Unity Development Guide开发指南 Unity3D教程 第9张

OVRPlayerController OVRPlayerController为VR框架实现第一人称视角的控制。它绑定在OVRPlayerController预制体上,同时捆绑的还有一个OVRCameraRig。



当设置了HMD旋转Y时,实际上的摄像头的Y轴旋转角会采用其父变换矩阵(parent transform)的Y轴旋转值。




注意:目前原生的兼容X轴输入的控制器都不支持Mac OS。碰到这种情况请使用传统的Unity输入方案来解决这个问题。

OVRMainMenu 用来控制不同场景间的读取工作。同时渲染出一个可以让玩家在VR框架中进行设置的菜单,同时允许把设置结果存起来以便今后使用。



OVRCrosshair 是一个渲染和控制屏幕上的十字准线的辅助类。目前由OVRMainMenu组件来控制。

OVRGUI 是一个辅助类,不管2D还是3D的基础渲染文本,它都可以对其进行封装。



OVRPresetManager是一个辅助类,当使用Unity PlayerPrefs类时可以用来储存一系列变量以供使用。


Oculus Mobile SDKExamples


The SDK Examples project (included with the mobile SDK only)demonstrates useful scenarios and functionality.


To import SDKExamples into Unity, begin by creating a new, emptyproject. Then select Assets > Custom Package... and selectSDKExamples.unityPackage to import the assets into your project. Alternately,you can locate the SDKExamples.unityPackage and double-click to launch, whichwill have the same effect.


Once imported, replace your Unity project's ProjectSettings folderwith the ProjectSettings folder included with SDKExamples.


Oculus Unity Development Guide开发指南 Unity3D教程 第10张