Exemplo n.º 1
0
        /// <summary>
        /// 动态改变进度值。
        /// </summary>
        /// <param name="value"></param>
        /// <param name="duration"></param>
        public GTweener TweenValue(double value, float duration)
        {
            double oldValule;

            if (_tweening)
            {
                GTweener twener = GTween.GetTween(this, TweenPropType.Progress);
                oldValule = twener.value.d;

                twener.Kill(false);
            }
            else
            {
                oldValule = _value;
            }

            oldValule = _value;

            _value    = value;
            _tweening = true;
            return(GTween.ToDouble(oldValule, _value, duration)
                   .SetEase(EaseType.Linear)
                   .SetTarget(this, TweenPropType.Progress)
                   .OnComplete(() => { _tweening = false; }));
        }
Exemplo n.º 2
0
		/// <summary>
		/// 动态改变进度值。
		/// </summary>
		/// <param name="value"></param>
		/// <param name="duration"></param>
		public GTweener TweenValue(double value, float duration)
		{
			double oldValule;

			GTweener twener = GTween.GetTween(this, TweenPropType.Progress);
			if (twener != null)
			{
				oldValule = twener.value.d;
				twener.Kill(false);
			}
			else
				oldValule = _value;

			_value = value;
			return GTween.ToDouble(oldValule, _value, duration)
				.SetEase(EaseType.Linear)
				.SetTarget(this, TweenPropType.Progress);
		}