예제 #1
0
        protected override void Update()
        {
            float deltaTime = this.IsAffectedByTimeScaling ? Time.deltaTime : Time.unscaledDeltaTime;

            if (this.IsFadeDelayRunning)
            {
                _fadeDelay -= deltaTime;
                if (_fadeDelay <= 0)
                {
                    _fadeDelay = null;
                    this.BeginFading();
                }
            }
            else if (this.IsFading)
            {
                _currentFadeTime += deltaTime;
                _alpha            = FlaiMath.Min(1, _currentFadeTime / this.CurrentFade.Time);
                _alpha            = this.IsFadingIn ? _alpha : (1 - _alpha);
                if (_currentFadeTime >= this.CurrentFade.Time)
                {
                    _currentFadeTime = 0;
                    this.OnFadeCompleted();
                }
            }
        }
예제 #2
0
        public void AddLast(ref T value)
        {
            if (++_headIndex == _buffer.Length)
            {
                _headIndex = 0;
            }

            _buffer[_headIndex] = value;
            if (_size == _buffer.Length)
            {
                if (++_tailIndex == _buffer.Length)
                {
                    _tailIndex = 0;
                }
            }
            _size = FlaiMath.Min(_size + 1, _buffer.Length);
        }