Getting Started with SRWorks Experience in Unity

Prerequisites

To work with this demo project, import all following packages into your project:

  • SteamVR

  • SRWorks SDK Unity Plugin > ViveSR

  • Sample Code Project: Experience Demo > ViveSR_Experience

../_images/figure1_project_window_after_importing.png

Samples

In Experience_Unity > Assets > ViveSR_Experience > Scenes, there are 9 scenes:

../_images/figure2_nine_sample_scenes_and_a_demo_scene.png

Demo.unity serves as an introduction scene that demonstrates most of SRWorks’ features to new users in one go. If you spot some specific features you would like to use, you can check out the sample scenes (e.g. Sample1_Effects_SwitchMode.unity) to trace code. The sample scenes are breakdowns of all of the features shown in Demo.unity. Unlike Demo.unity, each sample scene targets only one or two features of SRWorks. Therefore, it will be easier to find out about how to call some specific features of SRWorks in those Sample scene than it will in the Demo scene. This document will explain the structure of those sample scenes.

Sample Structure

Each sample scene is constructed in this basic structure:

GameObject

Components

Description

Initialization

ViveSR_Experience_Initialization

Tests whether a VIVE Controller, the HMD, and SRWorks Unity Plugin are ready

ViveSR_Experience_ControllerDelegate

Handles controller input events

Sample#_[SceneName]

ViveSR_ControllerLatency

Aligns the virtual controller with the real-world controller

ViveSR_Experience

Stores property references frequently used in this projec

Sample#_[SceneName]

Demonstrates specific functions

In some fairly complex scenes and on top of this structure, there are some additional GameObjects and components to look into. These additional components will be discussed later in this document.