I’ve used Animator to create two animation states, I want to change the speed of these animations at run type. How can I get these animations at run time and change their speed? Do I have to attach Animation component or Animator is enough?
Hello,
I use following code to add Destroy Handler Function into end of a clip realtime. Maybe It will help you to get clip information:
`
public bool f_AddDestroy() {
if (m_IsAddedDestroy)
return false;
AnimationInfo[] t_animInfo = m_SpriteX.m_Animator.GetCurrentAnimationClipState(0);
if (t_animInfo.Length > 0) {
AnimationClip t_clip = t_animInfo[0].clip;
AnimationEvent t_animEvent = new AnimationEvent();
t_animEvent.functionName = "f_EffectDone";
t_animEvent.time = t_clip.length;
t_animInfo[0].clip.AddEvent(t_animEvent);
m_IsAddedDestroy = true;
return true;
}
return false;
}
`