Skip to content

onUpdateParams

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

Keyword: onUpdateParams

Defines an object that is passed on every call to the methode defined by onUpdate

Parameter: Action or Action<object>

Example: "onUpdate", onTweenUpdate

In this example, the method "onTweenUpdate" is called on every tween update and logs the current x-position of the GameObject passed via onUpdateParams

tweenSharp tween = new TweenSharp(gameObject, 5f, new
{
	x = 8f,
	onUpdate = new Action<object>(onTweenUpdate),
	onUpdateParams = gameObject
} );

private void onTweenUpdate(object obj)
{
	Debug.Log("x: " + (obj as GameObject).transform.position.x );
}
Clone this wiki locally