Skip to content

onUpdateParams

Jan-Ole Schümann edited this page May 21, 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

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

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