void Update() { if (dashing) { enemy.SetSpeed(dashSpeed); } dashTimer += Time.deltaTime; if (inDashRange && dashTimer >= dashCooldown) { attack(); dashTimer = 0; } }
void Update() { if (enemy.inAction || this.WithinStopDistance()) { enemy.SetSpeed(0); } else { flipTimer += Time.deltaTime; if (flipTimer >= flipCooldown) { enemy.LookAtTarget(); flipTimer = 0; } enemy.SetSpeed(speed); } }