赞
踩
获取Animator动画的持续时间
- var clipsList =transform.GetComponent<Animator().runtimeAnimatorController.animationClips.ToList();
- var clip = clipsList.Where(c => c.name == AnimaName).FirstOrDefault();
- if (clip != null) return clip.length;
获取Spine动画的持续时间
- var anima = transform.GetComponent<SkeletonAnimation>().skeletonDataAsset.GetSkeletonData(true).FindAnimation(AnimaName);
- if (anima != null) return anima.Duration;
获取DragonBones动画的持续时间
return transform.GetComponent<DragonBones.UnityArmatureComponent>().animation.GetState(AnimaName)._animationData.duration;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。