Пример #1
0
 public void StartPinch()
 {
     if (!isPinching)
     {
         Debug.Log($"Start pinching");
         isPinching = true;
         Vector3    thumbIndexVector = indexTip.position - thumbTip.position;
         Collider[] cols             = Physics.OverlapSphere(thumbTip.position + thumbIndexVector * 0.5f, pinchSize);
         foreach (Collider c in cols)
         {
             IGrabbable grabbable = c.GetComponent <IGrabbable>();
             if (grabbable != null)
             {
                 grabbable.StartGrab();
                 grabbedObjects.Add(grabbable);
             }
         }
     }
 }