IMHOTEP Framework
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
SteamVR_Preferences.cs
1 //======= Copyright (c) Valve Corporation, All rights reserved. ===============
2 //
3 // Purpose: Preferences pane for how SteamVR plugin behaves.
4 //
5 //=============================================================================
6 
7 using UnityEngine;
8 using UnityEditor;
9 
10 public class SteamVR_Preferences
11 {
15  public static bool AutoEnableVR
16  {
17  get
18  {
19  return EditorPrefs.GetBool("SteamVR_AutoEnableVR", true);
20  }
21  set
22  {
23  EditorPrefs.SetBool("SteamVR_AutoEnableVR", value);
24  }
25  }
26 
27  [PreferenceItem("SteamVR")]
28  static void PreferencesGUI()
29  {
30  EditorGUILayout.BeginVertical();
31  EditorGUILayout.Space();
32 
33  // Automatically Enable VR
34  {
35  string title = "Automatically Enable VR";
36  string tooltip = "Should SteamVR automatically enable VR on launch and play?";
37  AutoEnableVR = EditorGUILayout.Toggle(new GUIContent(title, tooltip), AutoEnableVR);
38  string helpMessage = "To enable VR manually:\n";
39  helpMessage += "- go to Edit -> Project Settings -> Player,\n";
40  helpMessage += "- tick 'Virtual Reality Supported',\n";
41  helpMessage += "- make sure OpenVR is in the 'Virtual Reality SDKs' list.";
42  EditorGUILayout.HelpBox(helpMessage, MessageType.Info);
43  }
44 
45  EditorGUILayout.EndVertical();
46  }
47 }
48 
static bool AutoEnableVR
Should SteamVR automatically enable VR when opening Unity or pressing play.