Exemplo n.º 1
0
 internal void SetPinchHand(Hi5_Object_Pinch_Type handType, Hi5_Glove_Interaction_Hand hand)
 {
     if (mPinchType == Hi5_Object_Pinch_Type.ENone)
     {
         mPinchType = handType;
     }
     else if (mPinchType == Hi5_Object_Pinch_Type.EDouble)
     {
     }
     else if (mPinchType == handType)
     {
     }
     else
     {
         mPinchType = Hi5_Object_Pinch_Type.EDouble;
     }
     if (handType == Hi5_Object_Pinch_Type.ELeft)
     {
         m_left_hand = hand;
     }
     else if (handType == Hi5_Object_Pinch_Type.ERight)
     {
         m_right_hand = hand;
     }
 }
Exemplo n.º 2
0
 internal bool CancelPinchHand(Hi5_Object_Pinch_Type handType, out bool OtherIsRelease)
 {
     if (mPinchType == Hi5_Object_Pinch_Type.EDouble)
     {
         if (handType == Hi5_Object_Pinch_Type.ELeft)
         {
             mPinchType = Hi5_Object_Pinch_Type.ERight;
             if (m_right_hand != null)
             {
                 List <int> handList;
                 bool       IsOtherHandTrigger = false;
                 if (m_right_hand.mHandCollider.IsPinch(out handList))
                 {
                     if (handList != null)
                     {
                         foreach (int item in handList)
                         {
                             if (item == ObjectItem.idObject)
                             {
                                 IsOtherHandTrigger = true;
                                 break;
                             }
                         }
                     }
                 }
                 if (IsOtherHandTrigger)
                 {
                     ObjectItem.transform.parent = m_right_hand.mVisibleHand.palm.transform;
                     m_left_hand    = null;
                     OtherIsRelease = false;
                     return(false);
                 }
                 else
                 {
                     ObjectItem.transform.parent = Hi5_Interaction_Object_Manager.GetObjectManager().transform;
                     m_left_hand    = null;
                     OtherIsRelease = true;
                     m_right_hand   = null;
                     mPinchType     = Hi5_Object_Pinch_Type.ENone;
                     return(true);
                 }
             }
             else
             {
                 ObjectItem.transform.parent = Hi5_Interaction_Object_Manager.GetObjectManager().transform;
                 m_left_hand    = null;
                 OtherIsRelease = true;
                 m_right_hand   = null;
                 mPinchType     = Hi5_Object_Pinch_Type.ENone;
                 return(true);
             }
         }
         else if (handType == Hi5_Object_Pinch_Type.ERight)
         {
             mPinchType = Hi5_Object_Pinch_Type.ELeft;
             if (m_left_hand != null)
             {
                 List <int> handList;
                 bool       IsOtherHandTrigger = false;
                 if (m_left_hand.mHandCollider.IsPinch(out handList))
                 {
                     if (handList != null)
                     {
                         foreach (int item in handList)
                         {
                             if (item == ObjectItem.idObject)
                             {
                                 IsOtherHandTrigger = true;
                                 break;
                             }
                         }
                     }
                 }
                 if (IsOtherHandTrigger)
                 {
                     ObjectItem.transform.parent = m_left_hand.mVisibleHand.palm.transform;
                     m_right_hand   = null;
                     OtherIsRelease = false;
                     return(false);
                 }
                 else
                 {
                     ObjectItem.transform.parent = Hi5_Interaction_Object_Manager.GetObjectManager().transform;
                     m_right_hand   = null;
                     OtherIsRelease = true;
                     m_left_hand    = null;
                     mPinchType     = Hi5_Object_Pinch_Type.ENone;
                     return(true);
                 }
             }
             else
             {
                 ObjectItem.transform.parent = Hi5_Interaction_Object_Manager.GetObjectManager().transform;
                 m_right_hand   = null;
                 OtherIsRelease = true;
                 m_left_hand    = null;
                 mPinchType     = Hi5_Object_Pinch_Type.ENone;
                 return(true);
             }
         }
         else
         {
             ObjectItem.transform.parent = Hi5_Interaction_Object_Manager.GetObjectManager().transform;
             m_right_hand   = null;
             OtherIsRelease = true;
             m_left_hand    = null;
             mPinchType     = Hi5_Object_Pinch_Type.ENone;
             return(true);
         }
     }
     else if (mPinchType == handType)
     {
         mPinchType = Hi5_Object_Pinch_Type.ENone;
         if (handType == Hi5_Object_Pinch_Type.ELeft)
         {
             ObjectItem.transform.parent = Hi5_Interaction_Object_Manager.GetObjectManager().transform;
             OtherIsRelease = false;
             m_left_hand    = null;
         }
         else if (handType == Hi5_Object_Pinch_Type.ERight)
         {
             ObjectItem.transform.parent = Hi5_Interaction_Object_Manager.GetObjectManager().transform;
             OtherIsRelease = false;
             m_right_hand   = null;
         }
         else
         {
             ObjectItem.transform.parent = Hi5_Interaction_Object_Manager.GetObjectManager().transform;
             OtherIsRelease = false;
         }
         return(true);
     }
     else
     {
         ObjectItem.transform.parent = Hi5_Interaction_Object_Manager.GetObjectManager().transform;
         m_right_hand   = null;
         OtherIsRelease = true;
         m_left_hand    = null;
         mPinchType     = Hi5_Object_Pinch_Type.ENone;
         return(true);
     }
 }