コード例 #1
0
        /// <summary>
        /// Handle the user input related to the slider.
        /// </summary>
        private void HandleInput()
        {
            // When the touchpad is first touched, animate the handle and save the current touchpad x value.
            if (ControllerManager.Instance.GetButtonTouchDown(TouchpadButton))
            {
                _padXLastFrame = ControllerManager.Instance.GetTouchpadAxis().x;
                _sliderGraphics.StartHandleAnimation(true);
                return;
            }

            // When the touchpad is being touched.
            if (ControllerManager.Instance.GetButtonTouch(TouchpadButton))
            {
                UpdateSlider();
            }

            // When the touchpad is released.
            if (ControllerManager.Instance.GetButtonTouchUp(TouchpadButton))
            {
                _sliderGraphics.StartHandleAnimation(false);
            }
        }
コード例 #2
0
    /// <summary>
    /// Method for handling the user input.
    /// </summary>
    private void HandleInput()
    {
        // If the trigger button is pressed down when focusing on the slider.
        if (ControllerManager.Instance.GetButtonPressDown(TriggerButton) && _hasFocus)
        {
            _operatingSlider = true;
            _sliderGraphics.StartHandleAnimation(true);
            return;
        }

        // Update the slider as long as the trigger button is being pressed down.
        if (_operatingSlider)
        {
            UpdateSlider();
        }

        // When the trigger button is released, stop operating the slider.
        if (ControllerManager.Instance.GetButtonPressUp(TriggerButton))
        {
            _operatingSlider = false;
            _sliderGraphics.StartHandleAnimation(false);
            _sliderGraphics.StartVisualFeedbackAnimation(_hasFocus);
        }
    }