IEnumerator AfterAnimationTrigger() { yield return(new WaitForSeconds(GetComponent <Animator>().GetCurrentAnimatorStateInfo(0).length + delay)); OnAnimationEnd?.Invoke(); StartCoroutine("AfterAnimationTrigger"); }
IEnumerator WaitAnimationEnd( ) { yield return(null); // Animation 적용까지 기다림.. var stateInfo = _animator.GetCurrentAnimatorClipInfo(0); var test = stateInfo[0].clip; float f = test.apparentSpeed * 2.0f; //float time = stateInfo.length / stateInfo.speed; //yield return new WaitForSeconds( time ); if (_animationEndHandler != null) { _animationEndHandler.Invoke(); } _animationEndHandler = null; yield break; }