Skip to content

onUpdate

Jan-Ole Schümann edited this page May 21, 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 Dictionary<string, object>()
{
	{"x", 8f},
	{"onUpdate", onTweenUpdate}
} );

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