/// <summary> /// Create a TweenSlider Component and start a tween /// </summary> /// <param name="go">GameObject to apply tween to</param> /// <param name="duration">Duration of tween</param> /// <param name="value">The ending value for the tween</param> /// <param name="finished">A optional callback to fire when the tween is done</param> /// <returns>Returns a reference to the new TweenAlpha component</returns> public static TweenSlider Tween(GameObject go, float duration, float value, UnityAction finished = null) { TweenSlider cls = TweenMain.Tween <TweenSlider>(go, duration, finished); cls.from = cls.value; cls.to = value; cls.Start(); return(cls); }
/// <summary> /// Create a TweenSlider Component and start a tween /// </summary> /// <param name="go">GameObject to apply tween to</param> /// <param name="duration">Duration of tween</param> /// <param name="fromVal">The starting value for the tween</param> /// <param name="toVal">The ending value for the tween</param> /// <param name="style">The style of tween (Once, Looped, PingPong)</param> /// <param name="method">The Interpolation method of the tween</param> /// <param name="finished">A optional callback to fire when the tween is done</param> /// <returns>Returns a reference to the new TweenAlpha component</returns> public static TweenSlider Tween(GameObject go, float duration, float fromVal, float toVal, Style style, Method method, UnityAction finished = null) { TweenSlider cls = TweenMain.Tween <TweenSlider>(go, duration, style, method, finished); cls.from = fromVal; cls.to = toVal; cls.Start(); return(cls); }