private void RemoveHandDevice(OculusQuestHand hand)
        {
            if (hand == null)
            {
                return;
            }

            if (teleportPointers.TryGetValue(hand.ControllerHandedness, out CustomTeleportPointer pointer))
            {
                if (pointer == null)
                {
                    teleportPointers.Remove(hand.ControllerHandedness);
                }
                else
                {
                    pointer.Reset();
                }
                hand.TeleportPointer = null;
            }

            hand.CleanupHand();
            inactiveHandCache.Add(hand.ControllerHandedness, hand);

            CoreServices.InputSystem?.RaiseSourceLost(hand.InputSource, hand);
            trackedHands.Remove(hand.ControllerHandedness);

            RecyclePointers(hand.InputSource);
        }
Example #2
0
        private void RemoveHandDevice(OculusQuestHand hand)
        {
            if (hand == null)
            {
                return;
            }

            hand.CleanupHand();
            CoreServices.InputSystem?.RaiseSourceLost(hand.InputSource, hand);
            trackedHands.Remove(hand.ControllerHandedness);

            // Recycle pointers makes this loop obsolete. If you are using an MRTK version older than 2.3, please use the loop and comment out RecyclePointers.

            /*
             * foreach (IMixedRealityPointer pointer in hand.InputSource.Pointers)
             * {
             *  if (pointer == null) continue;
             *  pointer.Controller = null;
             * }
             */
            RecyclePointers(hand.InputSource);
        }