Unity Sample Framework (Legacy)
Updated: Dec 10, 2024
The Unity Sample Framework provides sample scenes for developers for common VR-specific features such as hand presence with controllers, locomotion, and custom hands. With the sample framework, you can study the sample scenes in the Unity Editor, see how features are implemented, and potentially integrate the framework in your own projects.
To encourage the usage of the content, it uses a very permissive license. For more information, see license.txt
in Assets\Oculus\SampleFramework
.
Download the
Oculus Integration or search for
Oculus Unity Integration in the Asset Store tab of the Unity Editor.
Importing the Sample Framework
The Sample Framework is a part of the Oculus Integration for Unity and can be found by searching for the Oculus Integration in the Asset Store tab of the Unity Editor. The Oculus Integration for Unity includes scripts, prefabs, and other resources to supplement Unity’s built-in support for VR development. The concepts, Game Objects, prefabs, and scripts used in the Sample Framework can be used in conjunction with the Oculus Integration for development of your own applications.
To import the Oculus Integration in Unity Editor:
- Verify that you have installed a recommended version of Unity (see Compatibility and Requirements for up-to-date information).
- Launch the Unity Editor and create a new project.
- Select the Asset Store tab and search for Oculus Integration. Import the integration into your project.
- You may be prompted to update
OVRPlugin
. It is recommended that you use the latest version. If there is an update and you install it, the Unity Editor will restart.
Exploring the Sample Scenes
Sample Framework scenes have been designed so that each one illustrates a basic concept important to Meta Quest development. To keep things as simple as possible, the sample scenes require no configuration beforehand, and can be played right after importing the Integration package and opening them.
Here are the steps for running Sample Framework scenes:
- In the Unity Project window, navigate to Oculus > SampleFramework > Usage.
- Open one of the Unity scenes in the folder.
- Press the Play button
The sample scene should begin playing. For details on the scenes, look at the descriptions in the following table and explore the scene topics where available. After you’ve run a sample scene, feel free to experiment with the objects, components, and scripts that make up the scene.
Content and Sample Scenes
The Sample Framework features reusable components that developers can use in their own existing projects and sample scenes that demonstrate the usage of these components.
Content used in the scenes can be found in the \Usage\
and \Core\
folders under \Assets\Oculus\SampleFramework\
. The content is divided between them as follows:
The \Core\
folder contains subfolders for each scene with content key to the scene’s core functionality. This content has been designed so developers can easily use them directly in their own existing projects.
The \Usage\
folder contains content that developers are not likely to want to use. This content generally has nothing directly to do with the interesting or prominent parts of the sample. They just demonstrate how to use the sample code in a working scene.
After the Oculus Integration has been imported, the sample scenes can be found in \Assets\Oculus\SampleFramework\Usage
. The samples are listed in the following table.
Scene | Concept Illustrated |
---|
| Demonstrates custom controller models and interactive animations. While discouraged for use in gameplay, developers may want to use controllers in some specific cases, such as tutorials or demos. |
| Demonstrates the use of custom hand models. Developers can use this as a starting point for their own hands by building on the existing models and animations. |
| Demonstrates how you can implement hand tracking to use hands to interact with objects in the physics system using a train example. |
| Demonstrates various movement schemes as examples of how you can implement locomotion in your own applications |
| Demonstrates how creating a UI with a OVROverlay compositor layer improves image quality and text clarity in comparison to an application layer UI. |
| A collection of eight samples that showcase augmented objects, lighting, overlay passthrough, hands, styles, selective passthrough, and surface project passthrough. |
| Demonstrates the most important features and concepts in a single scene. |
| Demonstrates the capabilities including handling and maintaining Spatial Anchors. |
| Shows a simple scene selection menu containing other scenes from the Unity Sample Framework. |
| Demonstrates how to play a stereo 180-degree video. |