IEnumerator WaitForAttackEffects(AttackEffect[] attackEffects) { SafeCoroutine[] coroutines = new SafeCoroutine[attackEffects.Length]; for (int i = 0; i < attackEffects.Length; i++) { coroutines[i] = attackEffects[i].InvokeEffect(gameObject); } while (coroutines.Any(x => x.IsRunning)) { yield return(null); } }
IEnumerator WaitForAttackEffects(AttackEffect[] attackEffects) { SafeCoroutine[] coroutines = new SafeCoroutine[attackEffects.Length]; for (int i = 0; i < attackEffects.Length; i++){ coroutines[i] = attackEffects[i].InvokeEffect(gameObject); } while (coroutines.Any(x => x.IsRunning)){ yield return null; } }