private IEnumerator PauseMovementForDamage(Entity owner, AnimatorData animator, string clip) { owner.Tags.Add(EntityTags.CantMove); yield return(null); while (!animator.Animator.IsAnimationComplete(clip)) { yield return(null); } owner.Tags.Remove(EntityTags.CantMove); }
private void CheckPlayingAnimation(AnimatorData data) { if (data.Event != null) { var msg = data.Event.Value; if (msg.OnEventComplete && data.Animator.IsAnimationEventComplete(msg.Clip) || data.Animator.IsAnimationComplete(msg.Clip)) { msg.Target.Post(data.Event.Value); data.Event = null; } } if (data.Animator.IsAnimationComplete() && !data.GetEntity().IsDead()) { data.Animator.PlayAnimation(data.GetEntity().Tags.Contain(EntityTags.Moving) ? AnimatorClips.Move : AnimatorClips.Idle); } }