Invoke repeating + add goal distance to neutral behavior
This commit is contained in:
parent
bf010f3476
commit
ca7ce8e645
4 changed files with 11 additions and 13 deletions
|
@ -2,9 +2,13 @@ using UnityEngine;
|
|||
|
||||
public class NeutralBehaviour : AbstractBehaviour
|
||||
{
|
||||
[SerializeField] private float distanceGoal = 0.0f;
|
||||
protected override void MoveAction()
|
||||
{
|
||||
Unit.MovementHandler.MoveTowardsNearest();
|
||||
Unit.MovementHandler.UpdateNearest();
|
||||
Vector3 targetPos = Unit.MovementHandler.TargetUnit.transform.position;
|
||||
Vector3 goalPos = targetPos + (transform.position - targetPos).normalized * distanceGoal;
|
||||
Unit.MovementHandler.MoveTowards(goalPos);
|
||||
}
|
||||
|
||||
protected override void AttackAction()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue