Skip to content

Commit e89863f

Browse files
committed
Version 1.2.1
1 parent 59cdcce commit e89863f

File tree

97 files changed

+684
-614
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+684
-614
lines changed

Assets/SteamVR/Editor/SteamVR_Settings.cs

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -108,49 +108,53 @@ static void Update()
108108
//window.title = "SteamVR";
109109
}
110110

111-
// Switch to native OpenVR support.
112-
var updated = false;
113-
114-
if (!PlayerSettings.virtualRealitySupported)
111+
if (SteamVR_Preferences.AutoEnableVR)
115112
{
116-
PlayerSettings.virtualRealitySupported = true;
117-
updated = true;
118-
}
113+
// Switch to native OpenVR support.
114+
var updated = false;
115+
116+
if (!PlayerSettings.virtualRealitySupported)
117+
{
118+
PlayerSettings.virtualRealitySupported = true;
119+
updated = true;
120+
}
119121

120122
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
121-
var devices = UnityEditorInternal.VR.VREditor.GetVREnabledDevices(BuildTargetGroup.Standalone);
123+
var devices = UnityEditorInternal.VR.VREditor.GetVREnabledDevices(BuildTargetGroup.Standalone);
122124
#else
123-
var devices = UnityEditorInternal.VR.VREditor.GetVREnabledDevicesOnTargetGroup(BuildTargetGroup.Standalone);
125+
var devices = UnityEditorInternal.VR.VREditor.GetVREnabledDevicesOnTargetGroup(BuildTargetGroup.Standalone);
124126
#endif
125-
var hasOpenVR = false;
126-
foreach (var device in devices)
127-
if (device.ToLower() == "openvr")
128-
hasOpenVR = true;
127+
var hasOpenVR = false;
128+
foreach (var device in devices)
129+
if (device.ToLower() == "openvr")
130+
hasOpenVR = true;
129131

130-
if (!hasOpenVR)
131-
{
132-
string[] newDevices;
133-
if (updated)
134-
{
135-
newDevices = new string[] { "OpenVR" };
136-
}
137-
else
132+
133+
if (!hasOpenVR)
138134
{
139-
newDevices = new string[devices.Length + 1];
140-
for (int i = 0; i < devices.Length; i++)
141-
newDevices[i] = devices[i];
142-
newDevices[devices.Length] = "OpenVR";
143-
updated = true;
144-
}
135+
string[] newDevices;
136+
if (updated)
137+
{
138+
newDevices = new string[] { "OpenVR" };
139+
}
140+
else
141+
{
142+
newDevices = new string[devices.Length + 1];
143+
for (int i = 0; i < devices.Length; i++)
144+
newDevices[i] = devices[i];
145+
newDevices[devices.Length] = "OpenVR";
146+
updated = true;
147+
}
145148
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
146-
UnityEditorInternal.VR.VREditor.SetVREnabledDevices(BuildTargetGroup.Standalone, newDevices);
149+
UnityEditorInternal.VR.VREditor.SetVREnabledDevices(BuildTargetGroup.Standalone, newDevices);
147150
#else
148-
UnityEditorInternal.VR.VREditor.SetVREnabledDevicesOnTargetGroup(BuildTargetGroup.Standalone, newDevices);
151+
UnityEditorInternal.VR.VREditor.SetVREnabledDevicesOnTargetGroup(BuildTargetGroup.Standalone, newDevices);
149152
#endif
150-
}
153+
}
151154

152-
if (updated)
153-
Debug.Log("Switching to native OpenVR support.");
155+
if (updated)
156+
Debug.Log("Switching to native OpenVR support.");
157+
}
154158

155159
var dlls = new string[]
156160
{
@@ -175,8 +179,7 @@ static void Update()
175179
}
176180

177181
Vector2 scrollPosition;
178-
bool toggleState;
179-
182+
180183
string GetResourcePath()
181184
{
182185
var ms = MonoScript.FromScriptableObject(this);

Assets/SteamVR/Editor/SteamVR_Update.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,37 @@
1212
[InitializeOnLoad]
1313
public class SteamVR_Update : EditorWindow
1414
{
15-
const string currentVersion = "1.2.0";
15+
const string currentVersion = "1.2.1";
1616
const string versionUrl = "http://media.steampowered.com/apps/steamvr/unitypluginversion.txt";
1717
const string notesUrl = "http://media.steampowered.com/apps/steamvr/unityplugin-v{0}.txt";
1818
const string pluginUrl = "http://u3d.as/content/valve-corporation/steam-vr-plugin";
1919
const string doNotShowKey = "SteamVR.DoNotShow.v{0}";
2020

21+
static bool gotVersion = false;
2122
static WWW wwwVersion, wwwNotes;
2223
static string version, notes;
2324
static SteamVR_Update window;
2425

2526
static SteamVR_Update()
2627
{
27-
wwwVersion = new WWW(versionUrl);
2828
EditorApplication.update += Update;
2929
}
3030

3131
static void Update()
3232
{
33-
if (wwwVersion != null)
33+
if (!gotVersion)
3434
{
35+
if (wwwVersion == null)
36+
wwwVersion = new WWW(versionUrl);
37+
3538
if (!wwwVersion.isDone)
3639
return;
3740

3841
if (UrlSuccess(wwwVersion))
3942
version = wwwVersion.text;
4043

4144
wwwVersion = null;
45+
gotVersion = true;
4246

4347
if (ShouldDisplay())
4448
{

0 commit comments

Comments
 (0)