Exemplo n.º 1
0
 public static Tween <TObject, Vector2> UseVector2Tween <TObject>(this TweenSettings settings, TObject target,
                                                                  TweenGetter <TObject, Vector2> getter, TweenSetter <TObject, Vector2> setter,
                                                                  EasingFunction easingFunction, float duration, Vector2 to, bool isRelative)
     where TObject : class
 {
     return(new Vector2Tween <TObject>(settings, target, getter, setter, easingFunction, duration, to, isRelative));
 }
Exemplo n.º 2
0
 public Tween(TweenSettings settings, TObject target, TweenGetter <TObject, TProperty> getter, TweenSetter <TObject, TProperty> setter, EasingFunction easingFunction, float duration, TProperty to, bool isRelativeTo)
 {
     this.Settings       = settings;
     this.target         = target;
     this.getter         = getter;
     this.setter         = setter;
     this.duration       = duration;
     this.easingFunction = easingFunction;
     this.originalTo     = to;
     this.isRelativeTo   = isRelativeTo;
 }
Exemplo n.º 3
0
 public ColorTween(
     TweenSettings settings,
     TObject target,
     TweenGetter <TObject, Color> getter,
     TweenSetter <TObject, Color> setter,
     EasingFunction easingFunction,
     float duration,
     Color to,
     bool isRelative)
     : base(settings, target, getter, setter, easingFunction, duration, to, isRelative)
 {
 }
Exemplo n.º 4
0
 public Vector4Tween(
     TweenSettings settings,
     TObject target,
     TweenGetter <TObject, Vector4> getter,
     TweenSetter <TObject, Vector4> setter,
     EasingFunction easingFunction,
     float duration,
     Vector4 to,
     bool isRelative)
     : base(settings, target, getter, setter, easingFunction, duration, to, isRelative)
 {
 }
Exemplo n.º 5
0
 public UInt64Tween(
     TweenSettings settings,
     TObject target,
     TweenGetter <TObject, ulong> getter,
     TweenSetter <TObject, ulong> setter,
     EasingFunction easingFunction,
     float duration,
     ulong to,
     bool isRelative)
     : base(settings, target, getter, setter, easingFunction, duration, to, isRelative)
 {
 }
Exemplo n.º 6
0
 public Int32Tween(
     TweenSettings settings,
     TObject target,
     TweenGetter <TObject, int> getter,
     TweenSetter <TObject, int> setter,
     EasingFunction easingFunction,
     float duration,
     int to,
     bool isRelative)
     : base(settings, target, getter, setter, easingFunction, duration, to, isRelative)
 {
 }
Exemplo n.º 7
0
 public DoubleTween(
     TweenSettings settings,
     TObject target,
     TweenGetter <TObject, double> getter,
     TweenSetter <TObject, double> setter,
     EasingFunction easingFunction,
     float duration,
     double to,
     bool isRelative)
     : base(settings, target, getter, setter, easingFunction, duration, to, isRelative)
 {
 }
Exemplo n.º 8
0
 public static Tween <TObject, long> UseInt64Tween <TObject>(
     this TweenSettings settings,
     TObject target,
     TweenGetter <TObject, long> getter,
     TweenSetter <TObject, long> setter,
     EasingFunction easingFunction,
     float duration,
     long to,
     bool isRelative)
     where TObject : class
 {
     return((Tween <TObject, long>) new TweenSettingsExtensions.Int64Tween <TObject>(settings, target, getter, setter, easingFunction, duration, to, isRelative));
 }
Exemplo n.º 9
0
        /// <summary>
        /// Creates a tween that animates a parameter from a given end value to
        /// the current value over a set duration.
        /// </summary>
        /// <typeparam name="T">The type of the parameter.</typeparam>
        /// <param name="interpolater">The function that interpolates values between the start and end value.</param>
        /// <param name="getter">The function that gets the current value of the parameter.</param>
        /// <param name="setter">The function that sets a new value of the parameter.</param>
        /// <param name="endValue">The end value of the parameter.</param>
        /// <param name="duration">The duration of the tween.</param>
        /// <returns>A new tween that animates the parameter.</returns>
        public static Tween From <T>(Interpolater <T> interpolater, TweenGetter <T> getter, TweenSetter <T> setter, T endValue, float duration)
        {
            if (TweenManager.Unloading)
            {
                return(null);
            }

            Tweener <T> tween = TweenManager.Instance.BuildTweener <T>();

            tween.interpolater = interpolater;
            tween.getter       = getter;
            tween.setter       = setter;
            tween.endValue     = endValue;
            tween.duration     = duration;
            tween.reversed     = true;

            return(tween);
        }
Exemplo n.º 10
0
 /// <summary>
 /// Creates a tween that animates a parameter to a given end value over
 /// a set duration.
 /// </summary>
 /// <param name="getter">The function that gets the current value of the parameter.</param>
 /// <param name="setter">The function that sets a new value of the parameter.</param>
 /// <param name="endValue">The end value of the parameter.</param>
 /// <param name="duration">The duration of the tween.</param>
 /// <returns>A new tween that animates the parameter.</returns>
 public static Tween To(TweenGetter <Vector3Int> getter, TweenSetter <Vector3Int> setter, Vector3Int endValue, float duration) =>
 To(Interpolation.Lerp, getter, setter, endValue, duration);
Exemplo n.º 11
0
 /// <summary>
 /// Creates a tween that animates a parameter to a given end value over
 /// a set duration.
 /// </summary>
 /// <param name="getter">The function that gets the current value of the parameter.</param>
 /// <param name="setter">The function that sets a new value of the parameter.</param>
 /// <param name="endValue">The end value of the parameter.</param>
 /// <param name="duration">The duration of the tween.</param>
 /// <returns>A new tween that animates the parameter.</returns>
 public static Tween To(TweenGetter <long> getter, TweenSetter <long> setter, long endValue, float duration) =>
 To(Interpolation.Lerp, getter, setter, endValue, duration);
Exemplo n.º 12
0
 /// <summary>
 /// Creates a tween that animates a parameter to a given end value over
 /// a set duration.
 /// </summary>
 /// <param name="getter">The function that gets the current value of the parameter.</param>
 /// <param name="setter">The function that sets a new value of the parameter.</param>
 /// <param name="endValue">The end value of the parameter.</param>
 /// <param name="duration">The duration of the tween.</param>
 /// <returns>A new tween that animates the parameter.</returns>
 public static Tween To(TweenGetter <double> getter, TweenSetter <double> setter, double endValue, float duration) =>
 To(Interpolation.Lerp, getter, setter, endValue, duration);
Exemplo n.º 13
0
 /// <summary>
 /// Creates a tween that animates a parameter from a given end value to
 /// the current value over a set duration.
 /// </summary>
 /// <param name="getter">The function that gets the current value of the parameter.</param>
 /// <param name="setter">The function that sets a new value of the parameter.</param>
 /// <param name="endValue">The end value of the parameter.</param>
 /// <param name="duration">The duration of the tween.</param>
 /// <returns>A new tween that animates the parameter.</returns>
 public static Tween From(TweenGetter <Color> getter, TweenSetter <Color> setter, Color endValue, float duration) =>
 From(Interpolation.Lerp, getter, setter, endValue, duration);
Exemplo n.º 14
0
 /// <summary>
 /// Creates a tween that animates a parameter from a given end value to
 /// the current value over a set duration.
 /// </summary>
 /// <param name="getter">The function that gets the current value of the parameter.</param>
 /// <param name="setter">The function that sets a new value of the parameter.</param>
 /// <param name="endValue">The end value of the parameter.</param>
 /// <param name="duration">The duration of the tween.</param>
 /// <returns>A new tween that animates the parameter.</returns>
 public static Tween From(TweenGetter <Rect> getter, TweenSetter <Rect> setter, Rect endValue, float duration) =>
 From(Interpolation.Lerp, getter, setter, endValue, duration);
Exemplo n.º 15
0
 /// <summary>
 /// Creates a tween that animates a parameter from a given end value to
 /// the current value over a set duration.
 /// </summary>
 /// <param name="getter">The function that gets the current value of the parameter.</param>
 /// <param name="setter">The function that sets a new value of the parameter.</param>
 /// <param name="endValue">The end value of the parameter.</param>
 /// <param name="duration">The duration of the tween.</param>
 /// <returns>A new tween that animates the parameter.</returns>
 public static Tween From(TweenGetter <Quaternion> getter, TweenSetter <Quaternion> setter, Quaternion endValue, float duration) =>
 From(Interpolation.Lerp, getter, setter, endValue, duration);
Exemplo n.º 16
0
 /// <summary>
 /// Creates a tween that animates a parameter from a given end value to
 /// the current value over a set duration.
 /// </summary>
 /// <param name="getter">The function that gets the current value of the parameter.</param>
 /// <param name="setter">The function that sets a new value of the parameter.</param>
 /// <param name="endValue">The end value of the parameter.</param>
 /// <param name="duration">The duration of the tween.</param>
 /// <returns>A new tween that animates the parameter.</returns>
 public static Tween From(TweenGetter <Vector4> getter, TweenSetter <Vector4> setter, Vector4 endValue, float duration) =>
 From(Interpolation.Lerp, getter, setter, endValue, duration);
Exemplo n.º 17
0
 /// <inheritdoc/>
 protected override void OnReset()
 {
     interpolater = null;
     getter       = null;
     setter       = null;
 }