public void Grab(VRHand hand, Vector3 position, Quaternion rotation) { if (Holder != null || !CanGrab) { return; } Holder = hand; holdPos = RelativePos(GrabRoot ? GrabRoot.position : position); holdRot = RelativeRot(GrabRoot ? GrabRoot.rotation : rotation); OnGrab.Invoke(hand.gameObject); }
public void Release(VRHand hand) { if (Holder != hand) { return; } TrackHolder(Holder.position, Holder.rotation); rb.velocity = SmoothVelocity; rb.angularVelocity = SmoothSpin; OnRelease.Invoke(hand.gameObject); Holder = null; }
public void Use(VRHand hand) { OnUse.Invoke(hand.gameObject); }