From 7550c10f0fc9e360ba256d02ab33962968f2cb93 Mon Sep 17 00:00:00 2001 From: Harvey Ball Date: Fri, 17 Nov 2017 15:34:17 +0000 Subject: [PATCH] fix(SnapDropZone): ensure valid object check is done at correct point The valid object check was being done after a touched object was added to the valid snap object list, meaning that any object that was not valid but touching the object would cause the highlighter to display even if the object was not valid. --- Assets/VRTK/Prefabs/SnapDropZone/VRTK_SnapDropZone.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/VRTK/Prefabs/SnapDropZone/VRTK_SnapDropZone.cs b/Assets/VRTK/Prefabs/SnapDropZone/VRTK_SnapDropZone.cs index 4a4715f6c..496d976cb 100644 --- a/Assets/VRTK/Prefabs/SnapDropZone/VRTK_SnapDropZone.cs +++ b/Assets/VRTK/Prefabs/SnapDropZone/VRTK_SnapDropZone.cs @@ -401,10 +401,10 @@ protected virtual void OnTriggerExit(Collider collider) protected virtual void CheckCanSnap(VRTK_InteractableObject interactableObjectCheck) { - if (interactableObjectCheck != null) + if (interactableObjectCheck != null && ValidSnapObject(interactableObjectCheck, true)) { AddCurrentValidSnapObject(interactableObjectCheck); - if (!isSnapped && ValidSnapObject(interactableObjectCheck, true)) + if (!isSnapped) { ToggleHighlight(interactableObjectCheck, true); interactableObjectCheck.SetSnapDropZoneHover(this, true);