// Update is called once per frame
    void Update()
    {
        Vector2 delta = waypoints[currentWaypointIndex] - (Vector2)transform.position;

        if (delta.magnitude < speed)
        {
            velocity = delta;
            nextWaypoint();
        }
        else
        {
            velocity = delta.normalized * speed;
        }
        movementControllerScript.FindPassengers();
        movementControllerScript.Move(velocity);
    }
예제 #2
0
 public void Update()
 {
     movementControllerScript.FindPassengers();
 }