public IEnumerator ApplyEffects(EffectTrigger trigger, Player.Player player) { foreach (var effect in GetEffects(trigger)) { Debug.Log(NameId + " " + effect.name); yield return(effect.ApplyEffect(player)); yield return(new WaitForSeconds(0.5f)); } }
private List <Effect> GetEffects(EffectTrigger trigger) { return(_isNeutralised ? new List <Effect>() : _data.EffectData.Where(e => e.Trigger == trigger).SelectMany(e => e.Effect).ToList()); }