Ejemplo n.º 1
0
 public void Grab()
 {
     if (handTarget != null && handTarget.grabbedObject == null)
     {
         Debug.Log("Grab" + handTarget + " " + handTarget.grabbedObject + " " + this.gameObject);
         HandInteraction.Grab(handTarget, this.gameObject, false);
     }
 }
Ejemplo n.º 2
0
        private void GrabObject(HandTarget handTarget, GameObject obj)
        {
            if (handTarget.otherHand.grabbedObject == obj)
            {
                LetGoObject(handTarget.otherHand);
            }

            HandInteraction.Grab(handTarget, obj, false);
            if (handTarget.grabbedObject == null)
            {
                Debug.LogWarning("Could not grab object");
            }
            else
            {
                Handle handle = obj.GetComponent <Handle>();
                if (handle == null)
                {
                    BarHandle.Create(obj, handTarget);
                }
                //handTarget.hand.MatchTargetToAvatar();
                //ArmMovements.Update(handTarget);
                //handTarget.CopyRigToTarget();
            }
        }