需要明确下几种动画的用法
play
begin
EventDelegate.add
TweenPlayer
------------------------------------------------------------------------
最基本的用法
TweenScale ts = TweenScale.Begin(mStartObj, 0.3f, new Vector3(0.9f, 0.9f, 1f));
ts.AddOnFinished(EnterNext);
EnterNext是个void方法
------------------------------------------------------------------------
直接获取组件
TweenPosition tp = tweenObject.GetComponent<TweenPosition>();
tp.PlayForward();
------------------------------------------------------------------------
void Start ()
{
TweenScale tweenpos = gameObject.AddComponent<TweenScale>();
tweenpos.onFinished =OnFinished;
tweenpos.from = transform.localScale;
tweenpos.to = new Vector3(1.2f,1.2f,1.2f);
tweenpos.duration = 0.2f;
tweenpos.Play(true);
}
void OnFinished (UITweener tween){}
升3.0后的写法
TweenScale scale = GetComponent<TweenScale>();
EventDelegate.Add (scale.onFinished, OnFinished);
------------------------------------------------------------------------
设置
_playTween.Play(true);
------------------------------------------------------------------------