Esempio n. 1
0
        /// <summary>
        /// Unregister an Interactor so it is no longer processed.
        /// </summary>
        /// <param name="interactor">The Interactor to be unregistered.</param>
        public virtual void UnregisterInteractor(XRBaseInteractor interactor)
        {
            if (!m_Interactors.Contains(interactor))
            {
                return;
            }

            CancelInteractorSelection(interactor);
            CancelInteractorHover(interactor);

            m_Interactors.Remove(interactor);

            m_InteractorUnregisteredEventArgs.manager    = this;
            m_InteractorUnregisteredEventArgs.interactor = interactor;
            interactor.OnUnregistered(m_InteractorUnregisteredEventArgs);
            interactorUnregistered?.Invoke(m_InteractorUnregisteredEventArgs);
        }
Esempio n. 2
0
        /// <summary>
        /// Unregister an Interactor so it is no longer processed.
        /// </summary>
        /// <param name="interactor">The Interactor to be unregistered.</param>
        public virtual void UnregisterInteractor(XRBaseInteractor interactor)
        {
            if (!m_Interactors.Contains(interactor))
            {
                return;
            }

            CancelInteractorSelection(interactor);
            CancelInteractorHover(interactor);

            m_Interactors.Remove(interactor);

#if AR_FOUNDATION_PRESENT
            if (interactor is ARGestureInteractor)
            {
                m_GestureInteractablesNeedReconnect = true;
            }
#endif

            m_InteractorUnregisteredEventArgs.manager    = this;
            m_InteractorUnregisteredEventArgs.interactor = interactor;
            interactor.OnUnregistered(m_InteractorUnregisteredEventArgs);
            interactorUnregistered?.Invoke(m_InteractorUnregisteredEventArgs);
        }