AnimatorStateInfo 状态机信息 动画激活 动画结束
2015-09-25 12:15
375 查看
动画状态机怎么判断动画是否播完了?
AnimatorStateInfo.normalizedTimefloat normalizedTime;
Description:
Normalized time of the State.
The integer part is the number of time a state has been looped. The fractional part is the % (0-1) of progress in the current loop.
2. 代码如下:
private Animator animator;
void Start()
{
animator = this.GetComponent<Animator>();
}
void Update()
{
AnimatorStateInfo info = animator.GetCurrentAnimatorStateInfo(0);
// 判断动画是否播放完成
if( info.normalizedTime >= 1.0f)
{
DoSomething();
}
}
相关文章推荐
- 天声人語 20150925
- 51nod 1287: 加农炮 好题啊好题
- Android AppWidget核心之AppWidgetService
- MySQL索引原理及慢查询优化
- 生育保险
- 51nod 1287: 加农炮 好题啊好题
- 复选框应用-全选/全不选/反选
- rhel7.0破root密码
- Android Bluetooth源码学习笔记01
- Mathematica 程序包 package
- 8、文件搜索 find
- redis教程(一):redis的安装
- Saiku汉化工作记录
- Android中RemoteViews的实现
- 【转】浮点数与十六进制如何转换?
- 机械革命X5(MECHREVO MR-X5)开包检验
- HTML文件模板替换到转换PDF文件并下载PDF文件
- ASP.NET MVC Application_Error 无效不执行
- uvalive 3490 解法二 AC自动机 + 高斯消元
- Linux系统管理-(20)-awk