Example #1
0
 private IEnumerator TriggerAppearingCoroutine()
 {
     _panel.sizeDelta = new Vector2(_panel.sizeDelta.x, 0);
     while (_lerpCoeff < 1f)
     {
         _lerpCoeff      += _appearingRate * Time.unscaledDeltaTime;
         _panel.sizeDelta = new Vector2(_panel.sizeDelta.x, Mathf.Lerp(0, _windowSize.y, _lerpCoeff));
         yield return(null);
     }
     _lerpCoeff = 1f;
     AppearingFinished?.Invoke();
     _triggeringCoroutine = null;
 }
Example #2
0
        private IEnumerator TriggerAppearingCoroutine()
        {
            _titlebarMask.sizeDelta = new Vector2(-_windowSize.x, _titlebarMask.sizeDelta.y);
            _contentMask.sizeDelta  = new Vector2(0, _titlebarMask.sizeDelta.y);

            while (_lerpCoeff < 1f)
            {
                _lerpCoeff += (1.1f - _lerpCoeff) * _appearingRate * Time.unscaledDeltaTime;
                _titlebarMask.sizeDelta = new Vector2(Mathf.Lerp(-_windowSize.x, 0, _lerpCoeff), _titlebarMask.sizeDelta.y);
                _contentMask.sizeDelta  = new Vector2(_titlebarMask.sizeDelta.x, Mathf.Lerp(_titlebarMask.sizeDelta.y, _contentSizeDeltaY, _lerpCoeff));
                yield return(null);
            }
            _lerpCoeff = 1f;
            AppearingFinished?.Invoke();
            _triggeringCoroutine = null;
        }