void TargetWalk() { if (target == null) { moveMethod = MoveMethods.Random; return; } Vector2 move = target.transform.position - transform.position; if (move.magnitude < followRange) { movement = Vector2.zero; } else { movement = GetRawVector(move); } }
public void SetMoveMethod(MoveMethods moveMethod) { movement = Vector2.zero; this.moveMethod = moveMethod; }