public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            if (SwitchState)
            {
                Counter += gameTime.ElapsedGameTime;

                if (Counter > StayOn)
                {
                    SwitchState = false;

                    SwitchedOff?.Invoke(this);
                    Toggled?.Invoke(this);
                }
            }
        }
Esempio n. 2
0
 protected virtual void OnSwitchedOff(EventArgs e)
 {
     SwitchedOff?.Invoke(this, e);
 }