void OnEndAttack() { DamageEffect.CreateDamageEffect(target.transform.position, -attacker.Attack); target.CurrentHealth -= attacker.Attack; attacker.CurrentHealth -= target.Attack; attacker.transform.DOMove(initialPos, 0.5f).SetEase(Ease.OutQuint).onComplete += OnEndBack; }
/// <summary> /// El fuerte es receptor de hechizos de efecto. Le pueden modificar la salud /// </summary> /// <param name="effect"></param> public void ApplyEffect(Effect effect) { maxHealth += effect.MaxHealth; if (effect.Health != 0) { Health += effect.Health; DamageEffect.CreateDamageEffect(transform.position, effect.Health); } }
void OnEndBack() { DamageEffect.CreateDamageEffect(attacker.transform.position, -target.Attack); CommandComplete(); }