public virtual void Grabbed(GrabBehaviour grabber = null)
 {
     GetComponent <Rigidbody>().useGravity  = false;
     GetComponent <Rigidbody>().isKinematic = true;
     GetComponent <Rigidbody>().velocity    = Vector3.zero;
     GetComponent <Rigidbody>().Sleep();
     GetComponent <Rigidbody>().WakeUp();
 }
Esempio n. 2
0
 public override void Grabbed(GrabBehaviour grabber = null)
 {
     base.Grabbed(grabber);
     Debug.Log(grabber.Role);
     if (grabber.Role == GrabBehaviour.HandRole.right)
     {
         RightHand = grabber;
     }
     else
     {
         LeftHand = grabber;
     }
     ReParent();
 }
Esempio n. 3
0
 public override void LetGo(Vector3 travelVelocity, GrabBehaviour grabber = null)
 {
     if (grabber == LeftHand)
     {
         LeftHand = null;
     }
     if (grabber == RightHand)
     {
         RightHand = null;
     }
     ReParent();
     if (transform.parent == null && LeftHand == null && RightHand == null)
     {
         base.LetGo(travelVelocity, grabber);
     }
 }
 public virtual void LetGo(Vector3 travelVelocity, GrabBehaviour grabber = null)
 {
     GetComponent <Rigidbody>().useGravity  = true;
     GetComponent <Rigidbody>().isKinematic = false;
     GetComponent <Rigidbody>().velocity   += travelVelocity;
 }