Пример #1
0
 public void Pickup(MoveableObject newItem)
 {
     if (item != null)
     {
         Drop();
     }
     item = newItem;
     item.GetComponents <Rigidbody>()
     .ForAll(body => {
         body.useGravity  = false;
         body.isKinematic = true;
     });
     item.transform.parent = guide;
 }
Пример #2
0
 public void Drop()
 {
     if (item != null)
     {
         if (item.isActiveAndEnabled)
         {
             item.GetComponents <Rigidbody>()
             .ForAll(body => {
                 body.useGravity  = true;
                 body.isKinematic = false;
             });
             item.transform.parent = transform.parent;
             item = null;
         }
     }
 }