# Getting started with Unity for see-through mode

## Download the Google VR SDK for Unity

- Download the latest `GoogleVRForUnity_*.unitypackage` from the [releases page](https://github.com/googlevr/gvr-unity-sdk/releases).

### Enabling see-through mode via the Unity prefab

1. Add the **GoogleVR \> Beta \> Prefabs \> GvrBetaHeadset** prefab to your scene. Note: [`GvrBetaHeadset`](https://developers.google.com/vr/reference/unity/class/GoogleVR/Beta/GvrBetaHeadset) supersedes [`GvrHeadset`](https://developers.google.com/vr/reference/unity/class/GvrHeadset). If the `GvrHeadset` prefab is present in your scene, remove it.
2. Select the `GvrBetaHeadset` object in the scene.
3. Using the component inspector for `GvrBetaHeadset`, configure see-through mode to be used at the startup of your scene.

### Enabling see-through mode via APIs

1. Check to see if the system supports see-through mode and if it is enabled
   using the class [`GvrBetaSettings`](https://developers.google.com/vr/reference/unity/class/GoogleVR/Beta/GvrBetaSettings),
   its methods [`IsFeatureSupported(...)`](https://developers.google.com/vr/reference/unity/class/GoogleVR/Beta/GvrBetaSettings#isfeaturesupported)
   and [`IsFeatureEnabled(...)`](https://developers.google.com/vr/reference/unity/class/GoogleVR/Beta/GvrBetaSettings#isfeatureenabled),
   and the enum [`GvrBetaFeature.SeeThrough`](https://developers.google.com/vr/reference/unity/namespace/GoogleVR/Beta#gvrbetafeature).

2. If it is supported but not enabled, request the user enable it by calling
   [`GvrBetaSettings.RequestFeatures(...)`](https://developers.google.com/vr/reference/unity/class/GoogleVR/Beta/GvrBetaSettings#requestfeatures)
   with an array containing the enum [`GvrBetaFeature.SeeThrough`](https://developers.google.com/vr/reference/unity/namespace/GoogleVR/Beta#gvrbetafeature).

       bool supported = GvrBetaSettings.IsFeatureSupported(GvrBetaFeature.SeeThrough);
       bool enabled = GvrBetaSettings.IsFeatureEnabled(GvrBetaFeature.SeeThrough);
       if (supported && !enabled)
       {
         GvrBetaFeature[] features = new GvrBetaFeature[] { GvrBetaFeature.SeeThrough };
         GvrBetaSettings.RequestFeatures(features, null);
       }

   The [`GvrBetaHeadset`](https://developers.google.com/vr/reference/unity/class/GoogleVR/Beta/GvrBetaHeadset)
   class provides the [`CameraMode`](https://developers.google.com/vr/reference/unity/class/GoogleVR/Beta/GvrBetaHeadset#cameramode)
   and [`SceneType`](https://developers.google.com/vr/reference/unity/class/GoogleVR/Beta/GvrBetaHeadset#scenetype)
   properties that let you set see-through mode and scene type, respectively.
   You can also use [`SetSeeThroughConfig`](https://developers.google.com/vr/reference/unity/class/GoogleVR/Beta/GvrBetaHeadset#setseethroughconfig)
   to set both properties simultaneously.

       GvrBetaHeadset.SetSeeThroughConfig(GvrBetaSeeThroughCameraMode.RawImage,
                                          GvrBetaSeeThroughSceneType.Virtual);

To ensure your scene composites with see-through mode properly, make sure the
**Clear Flags** option for the main camera is set to **Solid Color** and the
**Background color** is set to black with 0 Alpha.