this.$emit('event name', value);
子層向父層呼叫Method的方法。
子層向父層呼叫Method的方法。
Animator m_FirstAnim, m_SecondAnim;
m_FirstAnim.Play("Loop", 0, 0);
.....
.....
float myTime = 0;
AnimatorStateInfo animationState = m_FirstAnim.GetCurrentAnimatorStateInfo(0);
float newNormalIzedTime = animationState.normalizedTime - (float)System.Math.Truncate(animationState.normalizedTime);
AnimatorClipInfo[] targetAnimatorClip = m_FirstAnim.GetCurrentAnimatorClipInfo(0);
if (targetAnimatorClip.Length > 0)
{
myTime = targetAnimatorClip[0].clip.length * newNormalIzedTime;
}
else
{
myTime = newNormalIzedTime;
}
m_SecondAnim.Play("Loop", 0, myTime);