protected override void DrawInner(GraphicsContext graphicsContext) { if (_currentBooster == null) { if (_boosterState.ActiveBooster != null) { _currentBooster = _boosterState.ActiveBooster; } return; } this.DrawBooster(graphicsContext); }
private void UpdateAlpha(UpdateContext graphicsContext) { const float FadeSpeed = 2f; if (_boosterState.ActiveBooster == null) { // fade out _alpha = FlaiMath.Max(_alpha - graphicsContext.DeltaSeconds * FadeSpeed, 0); if (_alpha <= 0) { _currentBooster = null; } } else { // fade in _alpha = FlaiMath.Min(_alpha + graphicsContext.DeltaSeconds * FadeSpeed, 1); } }