public void AnimaionFinish() { if (m_Anim != null) { m_Anim.StopAllCoroutines(); EventDelegate.Remove(m_Anim.onFinished, AnimaionFinish); } InitState(); }
public void StopAnimation() { if (m_Transform != null) { UnityEngine.Transform tf = m_Transform.Find("Label"); if (tf != null) { m_Anim = null; UITweener[] t = tf.GetComponentsInChildren <UITweener>(); if (t.Length == 0) { Animation a = tf.GetComponent <Animation>(); if (a != null) { m_Anim = ActiveAnimation.Play(a, a.clip.name, AnimationOrTween.Direction.Forward, AnimationOrTween.EnableCondition.EnableThenPlay, AnimationOrTween.DisableCondition.DisableAfterForward); EventDelegate.Add(m_Anim.onFinished, AnimaionFinish, true); m_Anim.StopAllCoroutines(); } } } InitState(); } }