public static TweenSlider Begin(GameObject go, float duration, float fill) { TweenSlider tweenSlider = UITweener.Begin <TweenSlider>(go, duration); tweenSlider.from = tweenSlider.value; tweenSlider.to = fill; if (duration <= 0f) { tweenSlider.Sample(1f, true); tweenSlider.enabled = false; } return(tweenSlider); }
/// <summary> /// Start the tweening operation. /// </summary> static public TweenSlider Begin(GameObject go, float duration, float value) { TweenSlider comp = UITweener.Begin <TweenSlider>(go, duration); comp.from = comp.value; comp.to = value; if (duration <= 0.0f) { comp.Sample(1.0f, true); comp.enabled = false; } return(comp); }
public static TweenSlider Begin(Slider slider, float duration, float delay, float from, float to) { TweenSlider comp = UITweener.Begin <TweenSlider>(slider.gameObject, duration); comp.from = from; comp.to = to; comp.delay = delay; if (duration <= 0) { comp.Sample(1, true); comp.enabled = false; } return(comp); }
static public TweenSlider Begin(UISlider slider, float duration, float value) { TweenSlider comp = UITweener.Begin <TweenSlider>(slider.gameObject, duration); if (comp != null) { comp.from = comp.Value; comp.to = value; comp.slider = slider; if (duration <= 0.0f) { comp.Sample(1.0f, true); comp.enabled = false; } } return(comp); }
/// <summary> /// Start the tweening operation. /// </summary> static public TweenSlider Begin(GameObject go, float duration, float number) { #if UNITY_EDITOR if (!Application.isPlaying) { return(null); } #endif TweenSlider comp = UITweener.Begin <TweenSlider>(go, duration); comp.from = comp.number; comp.to = number; if (duration <= 0f) { comp.Sample(1f, true); comp.enabled = false; } return(comp); }
static public TweenSlider Begin(UISlider slider, float value, float speed, float maxDuration) { TweenSlider comp = UITweener.Begin <TweenSlider>(slider.gameObject, 1f); if (comp != null) { comp.from = comp.Value; comp.to = value; comp.slider = slider; comp.duration = Mathf.Max(0.1f, Mathf.Min(Mathf.Abs(comp.to = comp.from) / speed, maxDuration)); if (speed < 0.0f) { comp.Sample(1.0f, true); comp.enabled = false; } } return(comp); }