Esempio n. 1
0
 void SelectEnter(XRBaseInteractor interactor, XRBaseInteractable interactable)
 {
     // If Exclusive Selection, is this the only interactor trying to interact?
     if (interactor.requireSelectExclusive)
     {
         for (int i = 0; i < m_Interactors.Count; i++)
         {
             if (m_Interactors[i] != interactor &&
                 m_Interactors[i].selectTarget == interactable)
             {
                 return;
             }
         }
     }
     else
     {
         for (int i = 0; i < m_Interactors.Count; i++)
         {
             if (m_Interactors[i].selectTarget == interactable)
             {
                 SelectExit(m_Interactors[i], interactable);
             }
         }
     }
     interactor.OnSelectEnter(interactable);
     interactable.OnSelectEnter(interactor);
 }
Esempio n. 2
0
 void SelectEnter(XRBaseInteractor interactor, XRBaseInteractable interactable)
 {
     // allow new exclusive selection to take precedence over previous non-exclusive selection (useful Interactors like Sockets)
     if (interactor.isSelectExclusive)
     {
         for (int i = 0; i < m_Interactors.Count; i++)
         {
             if (m_Interactors[i].selectTarget == interactable && !m_Interactors[i].isSelectExclusive)
             {
                 SelectExit(m_Interactors[i], interactable);
             }
         }
     }
     interactor.OnSelectEnter(interactable);
     interactable.OnSelectEnter(interactor);
 }