private void ChangeAnimClip(ref AnimatorStateInfo info, AnimationClip clip) { curLength = clip.get_length(); curTimeScale = curLength; curMargin = 0.005f * (clip.get_length() / info.get_length()); beginTime = 0f; lastTime = curLength; lastNormalizedTime = 0f; lastSpeed = 0f; changeDelay = false; changeTransition = false; }
public IEnumerator CheckAnimationChange(Action <int, bool> StateChanged) { while (true) { AnimatorStateInfo currentAnimatorStateInfo = this.m_animator.GetCurrentAnimatorStateInfo(0); this.passTime += Time.get_deltaTime(); if (this.passTime >= currentAnimatorStateInfo.get_length()) { int introduced3 = currentAnimatorStateInfo.get_nameHash(); StateChanged(introduced3, currentAnimatorStateInfo.get_loop()); this.passTime = 0f; yield return(new WaitForFixedUpdate()); } yield return(new WaitForFixedUpdate()); } }