Wing的小站

  • 首页
  • IT新闻
  • 技术文章
  • 生活随笔
  • 休闲娱乐
  • 个人作品
  • 留言板
  • 关于博主
JavaFX,Unity3D,Android,IOS,技术教程,生活随笔
  1. 首页
  2. 技术文章
  3. 正文

NGUI TweenAnimation重复播放

2015年6月12日 3562点热度 0人点赞 0条评论

在我们使用NGUI的TweenAnimation的时候,默认的只播放一次,无法重复播放。

有时候我们需要重复播放,要么自己创建Animation,要么用代码来控制。

如下:

TweenPosition[] tweenPositions = aniObj.GetComponentsInChildren();
        foreach (TweenPosition tp in tweenPositions)
        {
            tp.ResetToBeginning();
            tp.PlayForward();
        }

上述代码就是获取aniObj里面所有子物体的TweenPosition,通过ResetToBeginning重置,然后PlayForward播放动画。

对于NGUI里面的动画开发来说,TweenAnimation是非常方便的,熟悉TweenAnimation的控制和重复播放还是很重要的。

标签: NGUI 从零开始学习JavaFX
最后更新:2017年4月14日

wing1314

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2023 Wing的小站. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

鄂ICP备17006951号-1

42011102000591