예제 #1
0
    // Update is called once per frame
    void Update()
    {
        if (Vector2.SqrMagnitude(body.position - target) < 0.1f)
        {
            new_target();
        }

        direction = (target - body.position).normalized;

        motor.move(direction);
    }
예제 #2
0
 // Update is called once per frame
 void Update()
 {
     motor.move(get_direction(player_1) + get_direction(player_2));
 }