Skip to Main Content
Table of Contents

BTD_Mod_Helper​.Api​.Tween


BloonsTD6 Mod Helper

BTD_Mod_Helper.Api

Tween Struct

Helper for performing animation Tweens

public readonly struct Tween

Properties

Tween.ElapsedTime Property

The elapsed time, in seconds, for the current tween cycle.

public float ElapsedTime { get; set; }

Property Value

System.Single

Tween.IsAlive Property

Whether this handle still points to a currently running tween.

public bool IsAlive { get; }

Property Value

System.Boolean

Tween.IsPaused Property

Whether this tween is currently paused.

public bool IsPaused { get; set; }

Property Value

System.Boolean

Tween.Progress Property

The normalized progress for the current tween cycle.

public float Progress { get; set; }

Property Value

System.Single

Methods

Tween.Alpha(CanvasGroup, float, float, Ease, bool) Method

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);

Parameters

target UnityEngine.CanvasGroup

endValue System.Single

duration System.Single

ease Ease

useUnscaledTime System.Boolean

Returns

Tween

Tween.AnchoredPosition(RectTransform, Vector2, float, Ease, bool) Method

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);

Parameters

target UnityEngine.RectTransform

endValue UnityEngine.Vector2

duration System.Single

ease Ease

useUnscaledTime System.Boolean

Returns

Tween

Tween.Color(Graphic, Color, float, Ease, bool) Method

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);

Parameters

target UnityEngine.UI.Graphic

endValue UnityEngine.Color

duration System.Single

ease Ease

useUnscaledTime System.Boolean

Returns

Tween

Tween.Complete() Method

Completes this tween immediately.

public void Complete();

Tween.Custom(Color, Color, float, Action, Ease, bool) Method

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);

Parameters

startValue UnityEngine.Color

endValue UnityEngine.Color

duration System.Single

onValueChange System.Action<UnityEngine.Color>

ease Ease

useUnscaledTime System.Boolean

Returns

Tween

Tween.Custom(float, float, float, Action, Ease, bool) Method

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);

Parameters

startValue System.Single

endValue System.Single

duration System.Single

onValueChange System.Action<System.Single>

ease Ease

useUnscaledTime System.Boolean

Returns

Tween

Tween.Custom(Object, float, float, float, Action, Ease, bool) Method

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);

Parameters

target UnityEngine.Object

startValue System.Single

endValue System.Single

duration System.Single

onValueChange System.Action<System.Single>

ease Ease

useUnscaledTime System.Boolean

Returns

Tween

Tween.Custom(Vector2, Vector2, float, Action, Ease, bool) Method

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);

Parameters

startValue UnityEngine.Vector2

endValue UnityEngine.Vector2

duration System.Single

onValueChange System.Action<UnityEngine.Vector2>

ease Ease

useUnscaledTime System.Boolean

Returns

Tween

Tween.Custom(Vector3, Vector3, float, Action, Ease, bool) Method

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);

Parameters

startValue UnityEngine.Vector3

endValue UnityEngine.Vector3

duration System.Single

onValueChange System.Action<UnityEngine.Vector3>

ease Ease

useUnscaledTime System.Boolean

Returns

Tween

Tween.EulerAngles(Transform, Vector3, float, Ease, bool) Method

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);

Parameters

target UnityEngine.Transform

endValue UnityEngine.Vector3

duration System.Single

ease Ease

useUnscaledTime System.Boolean

Returns

Tween

Tween.FromAlpha(CanvasGroup, float, float, Ease, bool) Method

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);

Parameters

target UnityEngine.CanvasGroup

startValue System.Single

duration System.Single

ease Ease

useUnscaledTime System.Boolean

Returns

Tween

Tween.FromAnchoredPosition(RectTransform, Vector2, float, Ease, bool) Method

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);

Parameters

target UnityEngine.RectTransform

startValue UnityEngine.Vector2

duration System.Single

ease Ease

useUnscaledTime System.Boolean

Returns

Tween

Tween.FromLocalPosition(Transform, Vector3, float, Ease, bool) Method

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);

Parameters

target UnityEngine.Transform

startValue UnityEngine.Vector3

duration System.Single

ease Ease

useUnscaledTime System.Boolean

Returns

Tween

Tween.FromScale(Transform, float, float, Ease, bool) Method

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);

Parameters

target UnityEngine.Transform

startValue System.Single

duration System.Single

ease Ease

useUnscaledTime System.Boolean

Returns

Tween

Tween.FromScale(Transform, Vector3, float, Ease, bool) Method

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);

Parameters

target UnityEngine.Transform

startValue UnityEngine.Vector3

duration System.Single

ease Ease

useUnscaledTime System.Boolean

Returns

Tween

Tween.LocalPosition(Transform, Vector3, float, Ease, bool) Method

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);

Parameters

target UnityEngine.Transform

endValue UnityEngine.Vector3

duration System.Single

ease Ease

useUnscaledTime System.Boolean

Returns

Tween

Tween.LocalRotation(Transform, Quaternion, float, Ease, bool) Method

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);

Parameters

target UnityEngine.Transform

endValue UnityEngine.Quaternion

duration System.Single

ease Ease

useUnscaledTime System.Boolean

Returns

Tween

Tween.OnComplete(Action) Method

Adds a callback invoked when this tween completes naturally or via Complete().

public BTD_Mod_Helper.Api.Tween OnComplete(System.Action onComplete);

Parameters

onComplete System.Action

Returns

Tween

Tween.OnUpdate(Action) Method

Adds a callback invoked every time this tween updates.

public BTD_Mod_Helper.Api.Tween OnUpdate(System.Action<BTD_Mod_Helper.Api.Tween> onUpdate);

Parameters

onUpdate System.Action<Tween>

Returns

Tween

Tween.Position(Transform, Vector3, float, Ease, bool) Method

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);

Parameters

target UnityEngine.Transform

endValue UnityEngine.Vector3

duration System.Single

ease Ease

useUnscaledTime System.Boolean

Returns

Tween

Tween.Rotation(Transform, Quaternion, float, Ease, bool) Method

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);

Parameters

target UnityEngine.Transform

endValue UnityEngine.Quaternion

duration System.Single

ease Ease

useUnscaledTime System.Boolean

Returns

Tween

Tween.Scale(Transform, Vector3, float, Ease, bool) Method

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);

Parameters

target UnityEngine.Transform

endValue UnityEngine.Vector3

duration System.Single

ease Ease

useUnscaledTime System.Boolean

Returns

Tween

Tween.SizeDelta(RectTransform, Vector2, float, Ease, bool) Method

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);

Parameters

target UnityEngine.RectTransform

endValue UnityEngine.Vector2

duration System.Single

ease Ease

useUnscaledTime System.Boolean

Returns

Tween

Tween.Stop() Method

Stops this tween without applying the end value.

public void Stop();

Tween.Stop(bool) Method

Stops this tween, optionally completing it first.

public void Stop(bool complete);

Parameters

complete System.Boolean

Tween.StopAll(bool) Method

Stops all active tweens.

public static void StopAll(bool complete=false);

Parameters

complete System.Boolean

Tween.StopAll(Object, bool) Method

Stops every tween currently associated with a target.

public static void StopAll(Object target, bool complete=false);

Parameters

target UnityEngine.Object

complete System.Boolean