今天发现原来NGUI的Tween效果可以用在任何对象上,下面记录下纯代码使用NGUI的Tween
TweenScale ts = gameObject.AddComponent<TweenScale>();
ts.from = Vector3.zero;
ts.to = Vector3.one;
ts.animationCurve = new AnimationCurve(new Keyframe[] { new Keyframe(0, 0), new Keyframe(1, 1), new Keyframe(2, 2) });
ts.AddOnFinished(new EventDelegate(this, PlayOver));
ts.style = UITweener.Style.Once;
ts.duration = 0.2f;
ts.delay = 0.1f;
ts.tweenGroup = 0;
ts.ignoreTimeScale = true;