Plugin Reference
Package Contents
The Unity plugin package contains the following:
Scripts
Cardboard.cs - Singleton connection to the native code VR device.
CardboardEye.cs - Applies an eye view/projection to a stereo camera.
CardboardHead.cs - Applies the Cardboard head view to its transform.
GazeInputModule.cs - Control uGUI elements with gaze and trigger.
Pose3D.cs - Contains a rotation and translation.
RadialUndistortionEffect.cs - Image Effect simulating distortion correction.
StereoController.cs - Controls mono vs stereo rendering.
Editor Scripts
CardboardEditor.cs - Customize parameters of the Cardboard object.
StereoControllerEditor.cs - Adds a button to update the stereo eye cameras.
Prefabs
CardboardMain - A drop-in replacement for a Main Camera object.
CardboardHead - A drop-in replacement for other cameras.
CardboardAdapter - Adds stereo rendering to an existing camera.
Shaders
RadialUndistortionEffect - Shader for simulating distortion correction.
Demo
DemoScene - Simple demonstration of the plugin.
Legacy
Features intended for supporting existing projects in older versions of Unity.
CardboardGUI.cs - Capture OnGUI onto a texture.
CardboardGUIWindow.cs - Show the OnGUI texture on a mesh in scene.
CardboardGUIMouse.cs - Control mouse by user's gaze; draw mouse pointer.
CardboardGUI prefab - Make it easy to show and interact with OnGUI in stereo.
SkyboxMesh.cs - Converts a Camera's skybox to a textured mesh at runtime.
StereoLensFlare.cs - Support directional lens flares but with parallax.
SkyboxMesh shader - Unlit textured background.
GUIScreen shader - Unlit textured overlay with transparency.
Scripts
This section covers the specific purpose of the individual scripts and how they work together, whether within the provided prefabs or if you add them to the scene yourself.
Cardboard.cs
Provides access to the underlying VR device, implemented in native code. There should only be one of these in a scene. An instance will be generated at runtime if needed, or you can add one via the Editor if you wish to customize its starting properties.
Types
<code>enum Eye { Left, Right }</code>
- Distinguishes between the two eyes.
<code>enum Distortion { Distorted, Undistorted }</code>