Skip to content

Commit a11be4e

Browse files
committed
2.6.1 - Excluding unused build target, SRP fix
Changes for 2.6.1 * Updated sdk header to 1.13.10 * Added support for Unity XR API * Added basic Universal Rendering Pipeline support * Added Exclusion for unused build targets * Fixed some error logging messages related to the old VR API. * Fixing obsolete API issue in unity 2020.2a * Moved System.ResetSeatedPosition to Chaperone.ResetZeroPosition(trackingUniverse) * Fixed some errors / warnings in 2020.1+ * Fixed HDRP error that would cause SteamVR to not start. (still no hdrp support for the interaction system)
1 parent b24952d commit a11be4e

File tree

5 files changed

+52
-51
lines changed

5 files changed

+52
-51
lines changed

Assets/SteamVR/Input/SteamVR_Input_ActionFile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ public class SteamVR_Input_Unity_AssemblyFile_Definition
598598
public string[] references = new string[] { "SteamVR" };
599599
public string[] optionalUnityReferences = new string[0];
600600
public string[] includePlatforms = new string[0];
601-
public string[] excludePlatforms = new string[0];
601+
public string[] excludePlatforms = new string[] { "Android" };
602602
public bool allowUnsafeCode = false;
603603
public bool overrideReferences = false;
604604
public string[] precompiledReferences = new string[0];

Assets/SteamVR/Scripts/SteamVR.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,13 @@ public static bool enabled
3030
{
3131
get
3232
{
33+
#if UNITY_2020_1_OR_NEWER || OPENVR_XR_API
34+
if (XRSettings.supportedDevices.Length == 0)
35+
enabled = false;
36+
#else
3337
if (!XRSettings.enabled)
3438
enabled = false;
39+
#endif
3540
return _enabled;
3641
}
3742
set

Assets/SteamVR/Scripts/SteamVR_Render.cs

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -406,43 +406,43 @@ void Update()
406406
if (SteamVR.active == false)
407407
return;
408408

409-
UpdatePoses();
410-
411409
// Dispatch any OpenVR events.
412410
var system = OpenVR.System;
413-
if (system != null)
411+
if (system == null)
412+
return;
413+
414+
UpdatePoses();
415+
416+
var vrEvent = new VREvent_t();
417+
var size = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VREvent_t));
418+
for (int i = 0; i < 64; i++)
414419
{
415-
var vrEvent = new VREvent_t();
416-
var size = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VREvent_t));
417-
for (int i = 0; i < 64; i++)
420+
if (!system.PollNextEvent(ref vrEvent, size))
421+
break;
422+
423+
switch ((EVREventType)vrEvent.eventType)
418424
{
419-
if (!system.PollNextEvent(ref vrEvent, size))
425+
case EVREventType.VREvent_InputFocusCaptured: // another app has taken focus (likely dashboard)
426+
if (vrEvent.data.process.oldPid == 0)
427+
{
428+
SteamVR_Events.InputFocus.Send(false);
429+
}
430+
break;
431+
case EVREventType.VREvent_InputFocusReleased: // that app has released input focus
432+
if (vrEvent.data.process.pid == 0)
433+
{
434+
SteamVR_Events.InputFocus.Send(true);
435+
}
436+
break;
437+
case EVREventType.VREvent_ShowRenderModels:
438+
SteamVR_Events.HideRenderModels.Send(false);
439+
break;
440+
case EVREventType.VREvent_HideRenderModels:
441+
SteamVR_Events.HideRenderModels.Send(true);
442+
break;
443+
default:
444+
SteamVR_Events.System((EVREventType)vrEvent.eventType).Send(vrEvent);
420445
break;
421-
422-
switch ((EVREventType)vrEvent.eventType)
423-
{
424-
case EVREventType.VREvent_InputFocusCaptured: // another app has taken focus (likely dashboard)
425-
if (vrEvent.data.process.oldPid == 0)
426-
{
427-
SteamVR_Events.InputFocus.Send(false);
428-
}
429-
break;
430-
case EVREventType.VREvent_InputFocusReleased: // that app has released input focus
431-
if (vrEvent.data.process.pid == 0)
432-
{
433-
SteamVR_Events.InputFocus.Send(true);
434-
}
435-
break;
436-
case EVREventType.VREvent_ShowRenderModels:
437-
SteamVR_Events.HideRenderModels.Send(false);
438-
break;
439-
case EVREventType.VREvent_HideRenderModels:
440-
SteamVR_Events.HideRenderModels.Send(true);
441-
break;
442-
default:
443-
SteamVR_Events.System((EVREventType)vrEvent.eventType).Send(vrEvent);
444-
break;
445-
}
446446
}
447447
}
448448

@@ -455,7 +455,7 @@ void Update()
455455
if (SteamVR.settings.lockPhysicsUpdateRateToRenderFrequency && Time.timeScale > 0.0f)
456456
{
457457
var vr = SteamVR.instance;
458-
if (vr != null)
458+
if (vr != null && Application.isPlaying)
459459
{
460460
//var timing = new Compositor_FrameTiming();
461461
//timing.m_nSize = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(Compositor_FrameTiming));

Assets/SteamVR/SteamVR.asmdef

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"UnityEngine.SpatialTracking"
77
],
88
"includePlatforms": [],
9-
"excludePlatforms": [],
9+
"excludePlatforms": [
10+
"Android"
11+
],
1012
"allowUnsafeCode": false,
1113
"overrideReferences": false,
1214
"precompiledReferences": [],

Assets/SteamVR/readme.txt

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SteamVR Unity Plugin - v2.6.0b4 (sdk 1.13.10)
1+
# SteamVR Unity Plugin - v2.6.1 (sdk 1.13.10)
22

33
Copyright (c) Valve Corporation, All rights reserved.
44

@@ -36,31 +36,25 @@ Input and Steam:
3636
If you publish your game to steam you can let users change their input bindings while the game is not running by setting the location of your action manifest. On the steamworks partner site go to the Application settings, and the Virtual Reality Section. At the bottom you'll see a radio button to designate your title as a SteamVR Input application. You then can set the location of your action manifest. In older versions of the plugin this was next to the executable. In versions 2.3.3 and above this is in [GameName]_Data/StreamingAssets/SteamVR/actions.json.
3737

3838

39-
Changes for 2.6.0b4
40-
41-
* Fixing obsolete API issue in unity 2020.2a
42-
43-
Changes for 2.6.0b3
39+
Changes for 2.6.1
4440

4541
* Updated sdk header to 1.13.10
4642

47-
* Moved System.ResetSeatedPosition to Chaperone.ResetZeroPosition(trackingUniverse)
48-
49-
Changes for 2.6.0b2
50-
51-
* Updated sdk header to 1.12.5
43+
* Added support for Unity XR API
5244

5345
* Added basic Universal Rendering Pipeline support
5446

55-
* Fixed some issues with Unity XR API
56-
57-
Changes for 2.6.0b1
47+
* Added Exclusion for unused build targets
5848

59-
* Updated sdk header to 1.11.11
49+
* Fixed some error logging messages related to the old VR API.
6050

61-
* Added support for Unity XR API
51+
* Fixing obsolete API issue in unity 2020.2a
52+
53+
* Moved System.ResetSeatedPosition to Chaperone.ResetZeroPosition(trackingUniverse)
6254

6355
* Fixed some errors / warnings in 2020.1+
56+
57+
* Fixed HDRP error that would cause SteamVR to not start. (still no hdrp support for the interaction system)
6458

6559
Changes for 2.5.0
6660

0 commit comments

Comments
 (0)