public void PerformUpdateAction() { if (!isGrabbable) { return; } if (enableToggleGrab == false) { if (isGrabbed) { if (OnGrabGrip.GetState(interactable.ActiveHand.m_Pose.inputSource) == true) { return; } else { interactable.RemoveCurrentInteractive(); } } else { if (OnGrabGrip.GetState(interactable.ActiveHand.m_Pose.inputSource) == false) { return; } else { interactable.SetCurrentInteractive(); } } } //for when grabbing is toggle mode else { if (OnGrabGrip.GetChanged(interactable.ActiveHand.m_Pose.inputSource)) { if (isGrabbed) { if (OnGrabGrip.GetState(interactable.ActiveHand.m_Pose.inputSource) == true) { isGrabbed = false; } else { return; } } else { if (OnGrabGrip.GetState(interactable.ActiveHand.m_Pose.inputSource) == true) { interactable.SetCurrentInteractive(); } else { interactable.RemoveCurrentInteractive(); } } } } }