Table of Contents

Method Tween

Namespace
Gamelogic.Extensions
Assembly
Gamelogic.Extensions.dll

Tween<T>(MonoBehaviour, T, T, float, Func<T, T, float, T>, Action<T>)

Tweens a value from start to finish over totalTime seconds.

public static Coroutine Tween<T>(this MonoBehaviour monoBehaviour, T start, T finish, float totalTime, Func<T, T, float, T> lerp, Action<T> action)

Parameters

monoBehaviour MonoBehaviour
start T

The starting value.

finish T

The ending value.

totalTime float

The total duration of the tween in seconds.

lerp Func<T, T, float, T>

A function to interpolate between two values.

action Action<T>

A callback invoked each frame with the current interpolated value.

Returns

Coroutine

The started coroutine.

Type Parameters

T

The type of the value to tween.

Tween<T>(MonoBehaviour, T, T, float, Func<T, T, float, T>, Action<T>, Func<float>)

Tweens a value from start to finish over totalTime seconds.

public static Coroutine Tween<T>(this MonoBehaviour monoBehaviour, T start, T finish, float totalTime, Func<T, T, float, T> lerp, Action<T> action, Func<float> deltaTime)

Parameters

monoBehaviour MonoBehaviour

The MonoBehaviour to start the coroutine on.

start T

The starting value.

finish T

The ending value.

totalTime float

The total duration of the tween in seconds.

lerp Func<T, T, float, T>

A function to interpolate between two values.

action Action<T>

A callback invoked each frame with the current interpolated value.

deltaTime Func<float>

A function that returns the delta time for each frame.

Returns

Coroutine

The started coroutine.

Type Parameters

T

The type of the value to tween.