コード例 #1
0
 public override void Dispose()
 {
     if (_tweening)
     {
         GTween.Kill(this);
     }
     base.Dispose();
 }
コード例 #2
0
        /// <summary>
        /// 动态改变进度值。
        /// </summary>
        /// <param name="value"></param>
        /// <param name="duration"></param>
        public GTweener TweenValue(double value, float duration)
        {
            double oldValule = _value;

            _value = value;

            if (_tweening)
            {
                GTween.Kill(this, TweenPropType.Progress, false);
            }
            _tweening = true;
            return(GTween.ToDouble(oldValule, _value, duration)
                   .SetEase(EaseType.Linear)
                   .SetTarget(this, TweenPropType.Progress)
                   .OnComplete(() => { _tweening = false; }));
        }