方法一:
move_X = Input.GetAxis("Horizontal") * Time.deltaTime *move_Speed;
move_Y = Input.GetAxis("Vertical") * Time.deltaTime * move_Speed;
Vector2 temp = gameObject.GetComponent<Rigidbody2D>().velocity;
temp = new Vector2(move_X, move_Y);
gameObject.GetComponent<Rigidbody2D>().velocity = temp*100;
方法二:
move_X = Input.GetAxis("Horizontal") * Time.deltaTime *move_Speed;
move_Y = Input.GetAxis("Vertical") * Time.deltaTime * move_Speed;
transform.Translate(move_X, move_Y, 0);
方法二缺点:在物体碰到碰撞盒时会有强烈的抖动