Example #1
0
 public void ChangeObjectInHands(GrabbableObject newObject, Transform hand)
 {
     if (ReferenceEquals(objectLeftHand, objectRightHand) || (newObject.GetComponent <GrabbableObject>() != null && !newObject.GetComponent <GrabbableObject>().RequiresBothHands))
     {
         objectInHands = newObject;
         objectInHands.ChangeParent(hand);
     }
 }
Example #2
0
    public void ClearObjectInHands()
    {
        if (objectInHands == null)
        {
            return;
        }

        if (!ReferenceEquals(objectLeftHand, objectInHands) || !ReferenceEquals(objectRightHand, objectInHands))
        {
            objectInHands.ChangeParent(null);
            objectInHands.AddForceInDirection(playerCamera.transform.forward);
            objectInHands = null;
        }
    }