コード例 #1
0
        protected override void DrawInner(GraphicsContext graphicsContext)
        {
            if (_currentBooster == null)
            {
                if (_boosterState.ActiveBooster != null)
                {
                    _currentBooster = _boosterState.ActiveBooster;
                }

                return;
            }

            this.DrawBooster(graphicsContext);
        }
コード例 #2
0
 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);
     }
 }