1
NGUI 3 Documentation / Re: Tweens
« on: January 31, 2014, 01:47:18 AM »
(Correct any of this if it's wrong, but this is what I've come to understand...)
In order to make use of a tween's onFinished property, create a callback method and assign it via the EventDelegate.Add() method:
Earlier implementations of UITweener allowed code such as:
but that has been deprecated in favor of the new format above.
In order to make use of a tween's onFinished property, create a callback method and assign it via the EventDelegate.Add() method:
- void OnTween1Complete()
- {
- // ...do stuff here...
- }
- void MyButtonClicked()
- {
- TweenScale tweenScale = TweenScale.Begin(gameObject, scaleAnimationTime, new Vector3(1.5f, 1.5f, 1.5f));
- EventDelegate.Add(tweenScale.onFinished, OnTween1Complete);
- }
Earlier implementations of UITweener allowed code such as:
- TweenScale.Begin(gameObject, 1f, Vector3.one).onFinished += SomeMethod;