public override void Tick() { if (HasLineOfSightToAttackTarget()) { brain.SetState(new AttackState(brain)); } if (Vector3.Distance(brainTransform.position, targetTransform.position) > distanceToStopAim) { brain.SetState(new IdleState(brain)); } }
private void EndAttack() { brain.AttackModule.OnAttackEnd -= EndAttack; if (HasLineOfSightToAttackTarget()) { brain.SetState(new AttackState(brain)); } else { brain.SetState(new AimState(brain)); } }
public override void Tick() { if (Vector3.Distance(brainTransform.position, targetTransform.position) < distanceToStartAim) { brain.SetState(new AimState(brain)); } }