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); } } }
protected virtual void OnSwitchedOff(EventArgs e) { SwitchedOff?.Invoke(this, e); }