Skip to content

Commit fad02ab

Browse files
committed
Version 1.2.3
1 parent 5530ef2 commit fad02ab

File tree

11 files changed

+321
-100
lines changed

11 files changed

+321
-100
lines changed

Assets/SteamVR/Editor/SteamVR_Update.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
[InitializeOnLoad]
1313
public class SteamVR_Update : EditorWindow
1414
{
15-
const string currentVersion = "1.2.2";
15+
const string currentVersion = "1.2.3";
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";

Assets/SteamVR/InteractionSystem/Core/Scripts/ItemPackageSpawner.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,19 @@ private ItemPackage GetAttachedItemPackage( Hand hand )
219219
//-------------------------------------------------
220220
private void HandHoverUpdate( Hand hand )
221221
{
222+
if ( takeBackItem && requireTriggerPressToReturn )
223+
{
224+
if ( hand.controller != null && hand.controller.GetHairTriggerDown() )
225+
{
226+
ItemPackage currentAttachedItemPackage = GetAttachedItemPackage( hand );
227+
if ( currentAttachedItemPackage == itemPackage )
228+
{
229+
TakeBackItem( hand );
230+
return; // So that we don't pick up an ItemPackage the same frame that we return it
231+
}
232+
}
233+
}
234+
222235
if ( requireTriggerPressToTake )
223236
{
224237
if ( hand.controller != null && hand.controller.GetHairTriggerDown() )

Assets/SteamVR/Plugins/openvr_api.cs

Lines changed: 256 additions & 49 deletions
Large diffs are not rendered by default.

Assets/SteamVR/Scripts/SteamVR_Camera.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,14 @@ public void Expand()
197197

198198
while (transform.childCount > 0)
199199
transform.GetChild(0).parent = head;
200-
200+
#if !UNITY_2017_2_OR_NEWER
201201
var guiLayer = GetComponent<GUILayer>();
202202
if (guiLayer != null)
203203
{
204204
DestroyImmediate(guiLayer);
205205
head.gameObject.AddComponent<GUILayer>();
206206
}
207-
207+
#endif
208208
var audioListener = GetComponent<AudioListener>();
209209
if (audioListener != null)
210210
{
@@ -228,14 +228,14 @@ public void Collapse()
228228
// Move children and components from head back to camera.
229229
while (head.childCount > 0)
230230
head.GetChild(0).parent = transform;
231-
231+
#if !UNITY_2017_2_OR_NEWER
232232
var guiLayer = head.GetComponent<GUILayer>();
233233
if (guiLayer != null)
234234
{
235235
DestroyImmediate(guiLayer);
236236
gameObject.AddComponent<GUILayer>();
237237
}
238-
238+
#endif
239239
if (ears != null)
240240
{
241241
while (ears.childCount > 0)

Assets/SteamVR/Scripts/SteamVR_LoadLevel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,8 @@ IEnumerator LoadLevel()
403403
// Fade out to compositor
404404
SteamVR_Events.LoadingFadeIn.Send(fadeInTime);
405405

406+
// Refresh compositor reference since loading scenes might have invalidated it.
407+
compositor = OpenVR.Compositor;
406408
if (compositor != null)
407409
{
408410
// Fade out foreground color if necessary.

Assets/SteamVR/Scripts/SteamVR_Render.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,10 @@ public void UpdatePoses()
337337
#else
338338
void OnCameraPreCull(Camera cam)
339339
{
340+
#if !( UNITY_5_4 )
341+
if (cam.cameraType != CameraType.VR)
342+
return;
343+
#endif
340344
// Only update poses on the first camera per frame.
341345
if (Time.frameCount != lastFrameCount)
342346
{

Assets/SteamVR/Scripts/SteamVR_RenderModel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
1+
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
22
//
33
// Purpose: Render model of associated tracked object
44
//
@@ -255,7 +255,7 @@ IEnumerator SetModelAsync(string renderModelName)
255255

256256
if (loading)
257257
{
258-
yield return new WaitForSeconds(0.1f);
258+
yield return new WaitForSecondsRealtime(0.1f);
259259
}
260260
else
261261
{
@@ -391,7 +391,7 @@ RenderModel LoadRenderModel(CVRRenderModels renderModels, string renderModelName
391391
if (error == EVRRenderModelError.None)
392392
{
393393
var diffuseTexture = MarshalRenderModel_TextureMap(pDiffuseTexture);
394-
var texture = new Texture2D(diffuseTexture.unWidth, diffuseTexture.unHeight, TextureFormat.ARGB32, false);
394+
var texture = new Texture2D(diffuseTexture.unWidth, diffuseTexture.unHeight, TextureFormat.RGBA32, false);
395395
if (SystemInfo.graphicsDeviceType == UnityEngine.Rendering.GraphicsDeviceType.Direct3D11)
396396
{
397397
texture.Apply();

Assets/SteamVR/Scripts/SteamVR_Stats.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@
55
//=============================================================================
66

77
using UnityEngine;
8+
9+
#if UNITY_2017_2_OR_NEWER
10+
11+
[ExecuteInEditMode]
12+
public class SteamVR_Stats : MonoBehaviour
13+
{
14+
void Awake()
15+
{
16+
Debug.Log("SteamVR_Stats is deprecated in Unity 2017.2 - REMOVING");
17+
DestroyImmediate(this);
18+
}
19+
}
20+
21+
#else
22+
823
using Valve.VR;
924

1025
public class SteamVR_Stats : MonoBehaviour
@@ -66,3 +81,5 @@ void Update()
6681
}
6782
}
6883

84+
#endif
85+

Assets/SteamVR/quickstart.pdf

-608 KB
Binary file not shown.

Assets/SteamVR/readme.txt

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
1-
SteamVR plugin for Unity - v1.2.2
1+
SteamVR plugin for Unity - v1.2.3
22
Copyright (c) Valve Corporation, All rights reserved.
33

44

5-
Quickstart:
5+
Requirements:
66

7-
To use, simply add the SteamVR_Camera script to your Camera object(s). Everything else gets set up at
8-
runtime. See the included quickstart guide for more details.
7+
The SteamVR runtime must be installed. This can be found in Steam under Tools.
98

109

11-
Requirements:
10+
Changes for v1.2.3:
1211

13-
The SteamVR runtime must be installed. This can be found in Steam under Tools.
12+
* Updated to SteamVR runtime v1515522829 and SDK version 1.0.12.
13+
14+
* Updated quickstart guide.
15+
16+
* [General] Fixed deprecation warnings for GUILayer in Unity version 2017.2 and newer (removed associated functionality).
17+
18+
* [LoadLevel] Fixed a crash when using SteamVR_LoadLevel to load a scene which has no cameras in it.
19+
20+
* [RenderModels] Switched from using TextureFormat.ARGB32 to RGBA32 to fix pink texture issue on Vulkan.
21+
22+
* [RenderModels] Fix for not initializing propery if game is paused on startup.
23+
https://github.com/ValveSoftware/steamvr_unity_plugin/issues/62
24+
25+
* [InteractionSystem] Added implemention for ItemPackageSpawner requireTriggerPressToReturn.
26+
https://github.com/ValveSoftware/steamvr_unity_plugin/pull/17/files
1427

1528

1629
Changes for v1.2.2:

0 commit comments

Comments
 (0)