Skip to content

onUpdate

Jan-Ole Schümann edited this page Jun 3, 2017 · 2 revisions

Keyword: onUpdate

Defines the method which is called on every update of the tween.

Parameter: Action or Action<object>

Example: "onUpdate", onTweenUpdate

In this example, the method "onTweenUpdate" is called on every tween update and logs the current progress of the tween.

TweenSharp tween;

Action onTweenUpdate= this.onTweenUpdate;
tween = new TweenSharp(gameObject, 5f, new
{
	x = 8f,
	onUpdate = new Action(onTweenUpdate)
});

private void onTweenUpdate()
{
	Debug.Log("Progress: " + tween.Progress);
}
Clone this wiki locally