public override void Update(GameTime gameTime)
        {
            if ((GameInstance.GetService <InputSystem>().GamePad.IsButtonDown(Buttons.A) || GameInstance.GetService <InputSystem>().Keyboard.IsKeyDown(Keys.G)) &&
                !Screen.HasBlockingElements &&
                ScriptPipelineManager.ActiveProcessorCount == 0) // only update these if this are no scripts running.
            {
                _buttonPressed += 0.035f;
                if (_buttonPressed >= 1f)
                {
                    _buttonPressed = 0f;
                    InteractionStarted?.Invoke(this);
                }
            }
            else
            {
                if (_buttonPressed > 0f)
                {
                    _buttonPressed -= 0.1f;
                    if (_buttonPressed <= 0f)
                    {
                        _buttonPressed = 0f;
                    }
                }
            }

            _buttonChart.Angle = MathHelper.TwoPi * _buttonPressed;
        }
Esempio n. 2
0
 private void OnInteractionStarted(Point e)
 {
     InteractionStarted?.Invoke(this, e);
 }