示例#1
0
    public void Drop()
    {
        if (m_TypeHand == Constants.HAND_PRIMARY_USE)
        {
            m_isPressedPrimaryPickup = false;
        }
        if (m_TypeHand == Constants.HAND_SECONDARY_USE)
        {
            m_isPressedSecundaryPickup = false;
        }

        if (m_TypeHand == Constants.HAND_NONE_USE)
        {
            m_isPressedPrimaryPickup   = false;
            m_isPressedSecundaryPickup = false;
        }

        if (m_currentIndexSelected < 0)
        {
            return;
        }

        if (!m_CurrentTakedSubspace)
        {
            return;
        }
        if (m_TypeHand == Constants.HAND_PRIMARY_USE)
        {
            if (m_CurrentTakedSubspace.m_PrimaryHand && !m_CurrentTakedSubspace.m_SecondaryHand)
            {
                Rigidbody targetBody = m_CurrentTakedSubspace.GetComponent <Rigidbody>();
                targetBody.velocity                  = Vector3.zero;
                targetBody.angularVelocity           = Vector3.zero;
                m_Joint.connectedBody                = null;
                m_CurrentTakedSubspace.m_PrimaryHand = null;
                m_CurrentTakedSubspace               = null;
            }
            else if (m_CurrentTakedSubspace.m_PrimaryHand && m_CurrentTakedSubspace.m_SecondaryHand)
            {
                m_CurrentTakedSubspace.ResetDistanceInitialForScale();
                m_CurrentTakedSubspace.m_PrimaryHand   = m_CurrentTakedSubspace.m_SecondaryHand;
                m_CurrentTakedSubspace.m_SecondaryHand = null;
                m_CurrentTakedSubspace = null;
                m_otherHand.m_isPressedPrimaryPickup   = true;
                m_otherHand.m_isPressedSecundaryPickup = false;
                m_otherHand.DetectTypeHand();
                m_otherHand.JoiningSubspace();
            }
        }

        else if (m_TypeHand == Constants.HAND_SECONDARY_USE)
        {
            m_CurrentTakedSubspace.ResetDistanceInitialForScale();
            m_CurrentTakedSubspace.m_SecondaryHand = null;
            m_CurrentTakedSubspace = null;
            JoiningSubspace();
        }
        DetectTypeHand();
    }
示例#2
0
 /**
  * Stop Scale mode and refactor type of Hands
  **/
 private void StopScaleAndAutoDetectHand(Subspace subspace)
 {
     subspace.ResetDistanceInitialForScale();
     // If the output MacroHand is the same that primaryHand
     if (this == subspace.m_PrimaryHand)
     {
         subspace.m_PrimaryHand                 = subspace.m_SecondaryHand;
         subspace.m_SecondaryHand               = null;
         m_CurrentTakedSubspace                 = null;
         m_otherHand.m_isPressedPrimaryPickup   = true;
         m_otherHand.m_isPressedSecundaryPickup = false;
         m_isPressedPrimaryPickup               = false;
         m_isPressedSecundaryPickup             = false;
         m_otherHand.DetectTypeHand();
         m_otherHand.JoiningSubspace();
     }
     else
     {
         subspace.m_SecondaryHand   = null;
         m_CurrentTakedSubspace     = null;
         m_isPressedPrimaryPickup   = false;
         m_isPressedSecundaryPickup = false;
         DetectTypeHand();
         m_otherHand.DetectTypeHand();
         m_otherHand.JoiningSubspace();
     }
     if (subspace.GetNumberUsedHandsInner() == 0)
     {
         subspace.m_PrimaryHand = null;
     }
 }
示例#3
0
    private void StopScaleBothHands(Subspace subspace)
    {
        subspace.ResetDistanceInitialForScale();
        subspace.m_PrimaryHand     = null;
        subspace.m_SecondaryHand   = null;
        m_CurrentTakedSubspace     = null;
        m_isPressedPrimaryPickup   = false;
        m_isPressedSecundaryPickup = false;
        Rigidbody targetBody = subspace.GetComponent <Rigidbody>();

        targetBody.velocity        = Vector3.zero;
        targetBody.angularVelocity = Vector3.zero;
        m_Joint.connectedBody      = null;
        m_otherHand.DetectTypeHand();
    }