public static TweenValue Begin(GameObject widget, TweenValueAdapter target, float duration, float value) { TweenValue.mTarget = target; TweenValue tweenValue = UITweener.Begin <TweenValue>(widget, duration); tweenValue.from = target.value; tweenValue.to = value; if (duration <= 0f) { tweenValue.Sample(1f, true); tweenValue.enabled = false; } return(tweenValue); }
/// <summary> /// Start the tweening operation. /// </summary> static public TweenValue Begin(GameObject widget, TweenValueAdapter target, float duration, float value) { mTarget = target; TweenValue comp = UITweener.Begin <TweenValue>(widget, duration); comp.from = target.value; comp.to = value; if (duration <= 0f) { comp.Sample(1f, true); comp.enabled = false; } return(comp); }