Example #1
0
        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);
        }
Example #2
0
        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;
        }
Example #3
0
 public void Use(VRHand hand)
 {
     OnUse.Invoke(hand.gameObject);
 }