private void AddTouchController(Touch touch, Ray ray)
        {
            if (!ActiveTouches.TryGetValue(touch.fingerId, out var controller))
            {
                try
                {
                    controller = new UnityTouchController(this, TrackingState.NotApplicable, Handedness.Any, GetControllerMappingProfile(typeof(UnityTouchController), Handedness.Any));
                }
                catch (Exception e)
                {
                    Debug.LogError($"Failed to create {nameof(UnityTouchController)}!\n{e}");
                    return;
                }

                for (int i = 0; i < controller.InputSource?.Pointers.Length; i++)
                {
                    var touchPointer = (IMixedRealityTouchPointer)controller.InputSource.Pointers[i];
                    touchPointer.TouchRay = ray;
                    touchPointer.FingerId = touch.fingerId;
                }

                ActiveTouches.Add(touch.fingerId, controller);
                AddController(controller);
            }

            MixedRealityToolkit.InputSystem?.RaiseSourceDetected(controller.InputSource, controller);

            controller.StartTouch();
            UpdateTouchData(touch, ray);
        }
        private void AddTouchController(Touch touch, Ray ray)
        {
            if (!ActiveTouches.TryGetValue(touch.fingerId, out var controller))
            {
                IMixedRealityInputSource inputSource = null;

                if (MixedRealityToolkit.InputSystem != null)
                {
                    var pointers = RequestPointers(typeof(UnityTouchController), Handedness.Any, true);
                    inputSource = MixedRealityToolkit.InputSystem.RequestNewGenericInputSource($"Touch {touch.fingerId}", pointers);
                }

                controller = new UnityTouchController(TrackingState.NotApplicable, Handedness.Any, inputSource);

                if (inputSource != null)
                {
                    for (int i = 0; i < inputSource.Pointers.Length; i++)
                    {
                        inputSource.Pointers[i].Controller = controller;
                        var touchPointer = (IMixedRealityTouchPointer)inputSource.Pointers[i];
                        touchPointer.TouchRay = ray;
                        touchPointer.FingerId = touch.fingerId;
                    }
                }

                if (!controller.SetupConfiguration(typeof(UnityTouchController)))
                {
                    Debug.LogError($"Failed to configure {typeof(UnityTouchController).Name} controller!");
                    return;
                }

                ActiveTouches.Add(touch.fingerId, controller);
                AddController(controller);
            }

            MixedRealityToolkit.InputSystem?.RaiseSourceDetected(controller.InputSource, controller);

            controller.StartTouch();
            UpdateTouchData(touch, ray);
        }