public bool Attack(UnitStats targetStats) { if (!(_attackCooldown <= 0)) { return(false); } targetStats.TakeDamage(_myStats.Damage.GetValue()); EventOnAttack?.Invoke(); _attackCooldown = 1f / _attackSpeed; return(true); }
public void TakeDamage(GameObject user, int damage) { _stats.TakeDamage(damage); DamageWithCombat(user); }