class Tween

Container for interpolation data.

Constructors

Tween(TweenTarget target, Vector3 startValue, Vector3 endValue, float duration, TweenInterpFunc interp, float startOffset)

Tween(Tween copyTween)

Tween()

Variables

TweenTarget Target

Target value to interpolate.

Vector3 StartValue

Initial value of the interpolation.

Vector3 EndValue

Final value of the interpolation.

float Duration

Length of time to interpolate in seconds.

float StartOffset

Time in seconds to wait after tween is played.

TweenInterpFunc Interp

Interpolation function.

AnimationCurve CustomInterp

Custom interpolation function.

Functions

void SetCustomInterp(AnimationCurve curve)

Set the curve of a custom interpolation function.

Parameters

AnimationCurve

Custom interpolation function.

void LerpTarget(GameObject gameObject, float t)

Interpolate to end value on tween target.

Parameters

GameObject

GameObject to adjust.

float

Value used to interpolate.

void FinaliseTarget(GameObject gameObject)

Make the tween target the end value.

Parameters

GameObject

GameObject to adjust.

float InterpFunc(float t)

Interpolate based on specified function. Functions adapted from https://easings.net/

Parameters

float

Value used to interpolate.

static Tween Mirror(Tween origTween)

Create a mirrored copy. Inverts the StartValue and EndValue.

Parameters

Tween

Tween to mirror.

Return

Tween

Mirrored result.