private void CheckPinch()
 {
     try
     {
         if (!m_grabbedObj && m_grabCandidates.Count > 0)
         {
             PinchGrabable closest = (PinchGrabable)FindClosestGrabble();
             //if (m_pinchManager.IsPinching(closest.PinchAction.Type))
             //{
             //    GrabBegin();
             //}
             if (m_pinchManager.IsPinchingWithRange(closest.PinchAction.Type, (closest.PinchAction.DifficultyPerPlayer / TherapyData._DifficultyRange)))
             {
                 GrabBegin();
             }
         }
         else if (m_grabbedObj && !m_pinchManager.IsPinching(((PinchGrabable)m_grabbedObj).PinchAction.Type))
         {
             GrabEnd();
         }
     }
     catch (Exception e)
     {
         m_debugText.text = e.Message;
     }
 }
Пример #2
0
 private void CheckPinch()
 {
     try
     {
         if (!m_grabbedObj && m_grabCandidates.Count > 0)
         {
             PinchGrabable closest = FindClosestGrabble() as PinchGrabable;
             if (closest == null)
             {
                 return;
             }
             if (m_pinchManager.IsPinchingWithRange(closest.PinchAction.Type, (closest.PinchAction.DifficultyPerPlayer / TherapyData._DifficultyRange)))
             {
                 GrabBegin();
                 PinchManager.PT++;
             }
         }
         else if (m_grabbedObj && !m_pinchManager.IsPinching(((PinchGrabable)m_grabbedObj).PinchAction.Type))
         {
             GrabEnd();
         }
     }
     catch (Exception e)
     {
         MainController.PrintToLog(e.ToString(), MainController.LogType.Error);
     }
 }