private void Update() { timeSinceLastAttack += Time.deltaTime; if (IsAttacking && target != null) { if (isOutOfRange()) { moveService.MoveTo(target.transform.position); } else { moveService.SetActive(false); moveService.RotateTowards(target.transform); AttackBehaviour(); } } }
public void MoveToPosition(Vector3 point) { moveService.MoveTo(point); actionScheduler.SetCurrentAction(this); }