public virtual bool GetPress()
 {
     if (raycaster is NRMultScrPointerRaycaster)
     {
         return(MultiScreenController.SystemButtonState.pressing);
     }
     else
     {
         return(NRInput.GetButton(raycaster.RelatedHand, ControllerButton.TRIGGER));
     }
 }
Ejemplo n.º 2
0
        private void UpdateGrabbles()
        {
            bool pressGrab     = NRInput.GetButton(handEnum, grabButton);
            bool grabAction    = !m_PreviousGrabPress && pressGrab;
            bool releaseAction = m_PreviousGrabPress && !pressGrab;

            m_PreviousGrabPress = pressGrab;
            if (grabAction && m_GrabbingList.Count == 0 && m_GrabReadyDict.Keys.Count != 0)
            {
                if (!grabMultiEnabled)
                {
                    NRGrabbableObject nearestGrabble = GetNearestGrabbleObject();
                    if (nearestGrabble)
                    {
                        GrabTarget(nearestGrabble);
                    }
                }
                else
                {
                    foreach (NRGrabbableObject grabble in m_GrabReadyDict.Keys)
                    {
                        GrabTarget(grabble);
                    }
                }
                SetChildrenCollidersEnabled(false);
            }

            if (releaseAction)
            {
                for (int i = 0; i < m_GrabbingList.Count; i++)
                {
                    m_GrabbingList[0].GrabEnd();
                }
                m_GrabbingList.Clear();
                SetChildrenCollidersEnabled(true);
            }

            if (m_GrabbingList.Count > 0 && !grabAction)
            {
                MoveGrabbingObjects();
            }
        }
Ejemplo n.º 3
0
 public virtual bool GetPress()
 {
     return(NRInput.GetButton(ControllerButton.TRIGGER));
 }