Beispiel #1
0
        /// <summary>
        /// For the provided <paramref name="interactor"/>, return a list of the valid Interactables that can be hovered over or selected.
        /// </summary>
        /// <param name="interactor">The Interactor whose valid targets we want to find.</param>
        /// <param name="validTargets">List to be filled with valid targets of the Interactor.</param>
        /// <returns>The list of valid targets of the Interactor.</returns>
        /// <seealso cref="XRBaseInteractor.GetValidTargets"/>
        public List <XRBaseInteractable> GetValidTargets(XRBaseInteractor interactor, List <XRBaseInteractable> validTargets)
        {
            interactor.GetValidTargets(validTargets);
            RemoveAllUnregistered(this, validTargets);

            return(validTargets);
        }
Beispiel #2
0
        internal List <XRBaseInteractable> GetValidTargets(XRBaseInteractor interactor, List <XRBaseInteractable> validTargets)
        {
            interactor.GetValidTargets(validTargets);

            // Remove interactables that are not being handled by this manager.
            for (int i = validTargets.Count - 1; i >= 0; --i)
            {
                if (!m_Interactables.Contains(validTargets[i]))
                {
                    validTargets.RemoveAt(i);
                }
            }
            return(validTargets);
        }