Example #1
0
    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);
        }
    }
Example #2
0
 public void SetMoveMethod(MoveMethods moveMethod)
 {
     movement        = Vector2.zero;
     this.moveMethod = moveMethod;
 }