Helper for performing animation Tweens
public readonly struct Tween
The elapsed time, in seconds, for the current tween cycle.
public float ElapsedTime { get; set; }
Whether this handle still points to a currently running tween.
public bool IsAlive { get; }
Whether this tween is currently paused.
public bool IsPaused { get; set; }
The normalized progress for the current tween cycle.
public float Progress { get; set; }
Tweens a CanvasGroup's alpha.
public static BTD_Mod_Helper.Api.Tween Alpha(CanvasGroup target, float endValue, float duration, BTD_Mod_Helper.Api.Ease ease=BTD_Mod_Helper.Api.Ease.Linear, bool useUnscaledTime=false);
target UnityEngine.CanvasGroup
endValue System.Single
duration System.Single
ease Ease
useUnscaledTime System.Boolean
Tweens a RectTransform's anchored position.
public static BTD_Mod_Helper.Api.Tween AnchoredPosition(RectTransform target, Vector2 endValue, float duration, BTD_Mod_Helper.Api.Ease ease=BTD_Mod_Helper.Api.Ease.Linear, bool useUnscaledTime=false);
target UnityEngine.RectTransform
endValue UnityEngine.Vector2
duration System.Single
ease Ease
useUnscaledTime System.Boolean
Tweens a UI graphic's color.
public static BTD_Mod_Helper.Api.Tween Color(Graphic target, Color endValue, float duration, BTD_Mod_Helper.Api.Ease ease=BTD_Mod_Helper.Api.Ease.Linear, bool useUnscaledTime=false);
target UnityEngine.UI.Graphic
endValue UnityEngine.Color
duration System.Single
ease Ease
useUnscaledTime System.Boolean
Completes this tween immediately.
public void Complete();
Creates a tween over a UnityEngine.Color value.
public static BTD_Mod_Helper.Api.Tween Custom(Color startValue, Color endValue, float duration, System.Action<Color> onValueChange, BTD_Mod_Helper.Api.Ease ease=BTD_Mod_Helper.Api.Ease.Linear, bool useUnscaledTime=false);
startValue UnityEngine.Color
endValue UnityEngine.Color
duration System.Single
onValueChange System.Action<UnityEngine.Color>
ease Ease
useUnscaledTime System.Boolean
Creates a tween over a float value.
public static BTD_Mod_Helper.Api.Tween Custom(float startValue, float endValue, float duration, System.Action<float> onValueChange, BTD_Mod_Helper.Api.Ease ease=BTD_Mod_Helper.Api.Ease.Linear, bool useUnscaledTime=false);
startValue System.Single
endValue System.Single
duration System.Single
onValueChange System.Action<System.Single>
ease Ease
useUnscaledTime System.Boolean
Creates a tween over a float value, associated with a target object for cancellation and lifetime checks.
public static BTD_Mod_Helper.Api.Tween Custom(Object target, float startValue, float endValue, float duration, System.Action<float> onValueChange, BTD_Mod_Helper.Api.Ease ease=BTD_Mod_Helper.Api.Ease.Linear, bool useUnscaledTime=false);
target UnityEngine.Object
startValue System.Single
endValue System.Single
duration System.Single
onValueChange System.Action<System.Single>
ease Ease
useUnscaledTime System.Boolean
Creates a tween over a UnityEngine.Vector2 value.
public static BTD_Mod_Helper.Api.Tween Custom(Vector2 startValue, Vector2 endValue, float duration, System.Action<Vector2> onValueChange, BTD_Mod_Helper.Api.Ease ease=BTD_Mod_Helper.Api.Ease.Linear, bool useUnscaledTime=false);
startValue UnityEngine.Vector2
endValue UnityEngine.Vector2
duration System.Single
onValueChange System.Action<UnityEngine.Vector2>
ease Ease
useUnscaledTime System.Boolean
Creates a tween over a UnityEngine.Vector3 value.
public static BTD_Mod_Helper.Api.Tween Custom(Vector3 startValue, Vector3 endValue, float duration, System.Action<Vector3> onValueChange, BTD_Mod_Helper.Api.Ease ease=BTD_Mod_Helper.Api.Ease.Linear, bool useUnscaledTime=false);
startValue UnityEngine.Vector3
endValue UnityEngine.Vector3
duration System.Single
onValueChange System.Action<UnityEngine.Vector3>
ease Ease
useUnscaledTime System.Boolean
Tweens a transform's local Euler angles.
public static BTD_Mod_Helper.Api.Tween EulerAngles(Transform target, Vector3 endValue, float duration, BTD_Mod_Helper.Api.Ease ease=BTD_Mod_Helper.Api.Ease.Linear, bool useUnscaledTime=false);
target UnityEngine.Transform
endValue UnityEngine.Vector3
duration System.Single
ease Ease
useUnscaledTime System.Boolean
Sets a CanvasGroup's alpha to a starting value, then tweens back to its current alpha.
public static BTD_Mod_Helper.Api.Tween FromAlpha(CanvasGroup target, float startValue, float duration, BTD_Mod_Helper.Api.Ease ease=BTD_Mod_Helper.Api.Ease.Linear, bool useUnscaledTime=false);
target UnityEngine.CanvasGroup
startValue System.Single
duration System.Single
ease Ease
useUnscaledTime System.Boolean
Sets a RectTransform's anchored position to a starting value, then tweens back to its current anchored position.
public static BTD_Mod_Helper.Api.Tween FromAnchoredPosition(RectTransform target, Vector2 startValue, float duration, BTD_Mod_Helper.Api.Ease ease=BTD_Mod_Helper.Api.Ease.Linear, bool useUnscaledTime=false);
target UnityEngine.RectTransform
startValue UnityEngine.Vector2
duration System.Single
ease Ease
useUnscaledTime System.Boolean
Sets a transform's local position to a starting value, then tweens back to its current local position.
public static BTD_Mod_Helper.Api.Tween FromLocalPosition(Transform target, Vector3 startValue, float duration, BTD_Mod_Helper.Api.Ease ease=BTD_Mod_Helper.Api.Ease.Linear, bool useUnscaledTime=false);
target UnityEngine.Transform
startValue UnityEngine.Vector3
duration System.Single
ease Ease
useUnscaledTime System.Boolean
Sets a transform's local scale to a starting value, then tweens back to its current local scale.
public static BTD_Mod_Helper.Api.Tween FromScale(Transform target, float startValue, float duration, BTD_Mod_Helper.Api.Ease ease=BTD_Mod_Helper.Api.Ease.Linear, bool useUnscaledTime=false);
target UnityEngine.Transform
startValue System.Single
duration System.Single
ease Ease
useUnscaledTime System.Boolean
Sets a transform's local scale to a starting value, then tweens back to its current local scale.
public static BTD_Mod_Helper.Api.Tween FromScale(Transform target, Vector3 startValue, float duration, BTD_Mod_Helper.Api.Ease ease=BTD_Mod_Helper.Api.Ease.Linear, bool useUnscaledTime=false);
target UnityEngine.Transform
startValue UnityEngine.Vector3
duration System.Single
ease Ease
useUnscaledTime System.Boolean
Tweens a transform's local position.
public static BTD_Mod_Helper.Api.Tween LocalPosition(Transform target, Vector3 endValue, float duration, BTD_Mod_Helper.Api.Ease ease=BTD_Mod_Helper.Api.Ease.Linear, bool useUnscaledTime=false);
target UnityEngine.Transform
endValue UnityEngine.Vector3
duration System.Single
ease Ease
useUnscaledTime System.Boolean
Tweens a transform's local rotation.
public static BTD_Mod_Helper.Api.Tween LocalRotation(Transform target, Quaternion endValue, float duration, BTD_Mod_Helper.Api.Ease ease=BTD_Mod_Helper.Api.Ease.Linear, bool useUnscaledTime=false);
target UnityEngine.Transform
endValue UnityEngine.Quaternion
duration System.Single
ease Ease
useUnscaledTime System.Boolean
Adds a callback invoked when this tween completes naturally or via Complete().
public BTD_Mod_Helper.Api.Tween OnComplete(System.Action onComplete);
onComplete System.Action
Adds a callback invoked every time this tween updates.
public BTD_Mod_Helper.Api.Tween OnUpdate(System.Action<BTD_Mod_Helper.Api.Tween> onUpdate);
onUpdate System.Action<Tween>
Tweens a transform's world position.
public static BTD_Mod_Helper.Api.Tween Position(Transform target, Vector3 endValue, float duration, BTD_Mod_Helper.Api.Ease ease=BTD_Mod_Helper.Api.Ease.Linear, bool useUnscaledTime=false);
target UnityEngine.Transform
endValue UnityEngine.Vector3
duration System.Single
ease Ease
useUnscaledTime System.Boolean
Tweens a transform's rotation.
public static BTD_Mod_Helper.Api.Tween Rotation(Transform target, Quaternion endValue, float duration, BTD_Mod_Helper.Api.Ease ease=BTD_Mod_Helper.Api.Ease.Linear, bool useUnscaledTime=false);
target UnityEngine.Transform
endValue UnityEngine.Quaternion
duration System.Single
ease Ease
useUnscaledTime System.Boolean
Tweens a transform's local scale.
public static BTD_Mod_Helper.Api.Tween Scale(Transform target, Vector3 endValue, float duration, BTD_Mod_Helper.Api.Ease ease=BTD_Mod_Helper.Api.Ease.Linear, bool useUnscaledTime=false);
target UnityEngine.Transform
endValue UnityEngine.Vector3
duration System.Single
ease Ease
useUnscaledTime System.Boolean
Tweens a RectTransform's size delta.
public static BTD_Mod_Helper.Api.Tween SizeDelta(RectTransform target, Vector2 endValue, float duration, BTD_Mod_Helper.Api.Ease ease=BTD_Mod_Helper.Api.Ease.Linear, bool useUnscaledTime=false);
target UnityEngine.RectTransform
endValue UnityEngine.Vector2
duration System.Single
ease Ease
useUnscaledTime System.Boolean
Stops this tween without applying the end value.
public void Stop();
Stops this tween, optionally completing it first.
public void Stop(bool complete);
complete System.Boolean
Stops all active tweens.
public static void StopAll(bool complete=false);
complete System.Boolean
Stops every tween currently associated with a target.
public static void StopAll(Object target, bool complete=false);
target UnityEngine.Object
complete System.Boolean