Пример #1
0
 public void TakeClosestBox()
 {
     TakableBox[] boxes = GameObject.FindObjectsOfType <TakableBox>();
     foreach (TakableBox box in boxes)
     {
         if (box.TryToTakeBox(controlledObject, controlledObject.GetComponent <Collider>()))
         {
             currentBox = box;
             break;
         }
     }
 }
Пример #2
0
 public void DropBox()
 {
     currentBox.Drop(controlledObject.GetComponent <Collider>());
     currentBox = null;
 }