Exemple #1
0
        /// <summary>
        /// Adds any gestures that were simulated during the last sensor frame to the current gesture data.
        /// Warns when unavailable or inactive gestures are simulated, and skips them.
        /// </summary>
        private void UpdateGestureData()
        {
            while (_pendingGestures.Count > 0)
            {
                GestureData gestureData = _pendingGestures.Dequeue();
                if (_config.GetGestureConfig(gestureData.gestureId).isEnabled&&
                    _virtualDevice.IsGestureAvailable(gestureData.gestureId))
                {
                    // If the gesture is enabled and available, go ahead and trigger it.
                    if (_verbose)
                    {
                        Debug.LogFormat(WearableConstants.DebugProviderTriggerGesture, Enum.GetName(typeof(GestureId), gestureData.gestureId));
                    }

                    _currentGestureData.Add(gestureData);
                }
                else
                {
                    // Otherwise, warn, and drop the gesture from the queue.
                    Debug.LogWarning(WearableConstants.DebugProviderTriggerDisabledGestureWarning);
                }
            }
        }