NGUI中动画的代码使用

来源:互联网 发布:java synchronized 块 编辑:程序博客网 时间:2024/06/03 20:52

今天发现原来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;


0 0
原创粉丝点击