void LateUpdate() { var hit = hrt.GetHit(whichHand); if (!hit.isHandHovering && shown) { Hide(); } if (hit.isHandHovering && !shown && !forceHide) { Show(); } if (hit.isHandHovering) { targetPosition = hit.point; circle.radius = Vector2.one * Mathf.Clamp(hand.pinchCloseness(), 0.2f, 1); Vector3 localTarget = transform.parent.InverseTransformPoint(targetPosition); if (minYTransform) { localTarget.y = Mathf.Clamp(localTarget.y, minYTransform.localPosition.y, float.PositiveInfinity); } transform.localPosition = localTarget; } }
void LateUpdate() { float d = hand.pinchCloseness(); Vector3 newPos = Vector3.zero; var hit = hrt.GetHit(whichHand); if (hit.isHandHovering) { transform.position = hit.point; transform.localScale = self.GetInitScale() * Mathf.Clamp(hand.pinchCloseness(), 0.2f, 1); if (!shown) { self.Show(0, 0.05f); shown = true; } } else { if (shown) { self.Hide(0, 0.05f); shown = false; } } }