/// <summary> /// Ends the attack, turning off the trails and caster and beginning the cooldown timer. /// </summary> void EndAttack () { attackCooldown.StartTimer (cooldownTime); if (!enemy.currentAttack.IsRanged ()) { attackCaster.End (); trailRenderer.enabled = false; } isAttacking = false; // TODO This is bad practice. When we refactor this, let's properly enapsulate // the current attack in one of these classes. enemy.currentAttack = null; }
void SetAttackActive(bool isActive) { if (attackCaster != null) { if (isActive) { attackCaster.Begin(currentAttack); } else { attackCaster.End(); } } }
virtual public void EndAttack() { attackCast.OnHit -= OnWeaponHit; attackCast.End(); }
/// <summary> /// End the sweep for damageable objects on the current attack /// </summary> void EndAttackCast() { attackCaster.End(); }
void DestroyProjectile() { attackCast.OnHit -= OnProjectileHit; attackCast.End(); Destroy(gameObject); }