//前后左右移动
public float moveSpeed = 20;
private float h;
private float v;
void LateUpdate () {
//物体前后左右移动
h = Input.GetAxis("Horizontal");
v = Input.GetAxis("Vertical");
transform.Translate(new Vector3(h, 0, v) * Time.deltaTime * moveSpeed);
}