public HandOverHelper(KinectRegion kinectRegion, Dispatcher d)
        {
            var timer = new DispatcherTimer(TimeSpan.FromMilliseconds(33), DispatcherPriority.Normal, (s, a) =>
            {
                var hoverNow = kinectRegion?.EngagedBodyTrackingIds?.Count > 0;

                if (hoverNow && !IsHover)
                {
                    OnHoverStart?.Invoke();
                }
                else if (IsHover && !hoverNow)
                {
                    OnHoverEnd?.Invoke();
                }
                IsHover = hoverNow;

                OnHoverKeyboardCheck?.Invoke();
            }, d);

            Task.Run(async() =>
            {
                await Task.Delay(TimeSpan.FromSeconds(3));
                OnHoverStart?.Invoke();
            });
        }
Esempio n. 2
0
 public void EndHover(RaycastHit hit)
 {
     OnHoverEnd.Invoke(hit);
 }