From 02e5a24b6101599944c32cf99ca0c36930a47a3f Mon Sep 17 00:00:00 2001 From: rrkpp Date: Sun, 31 Mar 2019 17:38:12 -0700 Subject: [PATCH] implement "AllowSidegrade" functionality in Hand.cs --- Assets/SteamVR/InteractionSystem/Core/Scripts/Hand.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/Hand.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/Hand.cs index 943ffd82..bdbbb520 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/Hand.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/Hand.cs @@ -1484,12 +1484,20 @@ public bool IsGrabEnding(GameObject attachedObject) { if (attachedObjects[attachedObjectIndex].attachedObject == attachedObject) { - return IsGrabbingWithType(attachedObjects[attachedObjectIndex].grabbedWithType) == false; + if ((attachedObjects[attachedObjectIndex].attachmentFlags & AttachmentFlags.AllowSidegrade) != 0) + return IsGrabbing() == false; + else + return IsGrabbingWithType(attachedObjects[attachedObjectIndex].grabbedWithType) == false; } } return false; } + + public bool IsGrabbing() + { + return IsGrabbingWithType(GrabTypes.Grip) || IsGrabbingWithType(GrabTypes.Pinch); + } public bool IsGrabbingWithType(GrabTypes type) {